103 using namespace reco;
126 void debugTrajectory(
const std::string,
Trajectory&);
140 void writeGlPosRcd(CLHEP::HepVector& d3);
143 return a(1)*
b(1)+
a(2)*
b(2)+
a(3)*
b(3);
150 virtual void endJob() ;
203 std::vector<AlignTransform>::const_iterator
205 std::vector<AlignTransform>::const_iterator
207 std::vector<AlignTransform>::const_iterator
209 std::vector<AlignTransform>::const_iterator
272 :trackTags_(iConfig.getParameter<edm::
InputTag>(
"tracks")),
273 muonTags_(iConfig.getParameter<edm::
InputTag>(
"muons")),
274 gmuonTags_(iConfig.getParameter<edm::
InputTag>(
"gmuons")),
275 smuonTags_(iConfig.getParameter<edm::
InputTag>(
"smuons")),
276 propagator_(iConfig.getParameter<string>(
"Propagator")),
278 cosmicMuonMode_(iConfig.getParameter<bool>(
"cosmics")),
279 isolatedMuonMode_(iConfig.getParameter<bool>(
"isolated")),
281 refitMuon_(iConfig.getParameter<bool>(
"refitmuon")),
282 refitTrack_(iConfig.getParameter<bool>(
"refittrack")),
284 rootOutFile_(iConfig.getUntrackedParameter<string>(
"rootOutFile")),
285 txtOutFile_(iConfig.getUntrackedParameter<string>(
"txtOutFile")),
286 writeDB_(iConfig.getUntrackedParameter<bool>(
"writeDB")),
287 debug_(iConfig.getUntrackedParameter<bool>(
"debug")),
290 #ifdef NO_FALSE_FALSE_MODE
293 <<
"Use from GlobalTrackerMuonAlignment_test_cfg.py.";
297 throw cms::Exception(
"BadConfig") <<
"Muon collection can be either cosmic or isolated! "
298 <<
"Please set only one to true.";
335 for(
int i=0;
i<=2;
i++){
337 for(
int j=0;
j<=2;
j++){
341 Grad = CLHEP::HepVector(6,0);
342 Hess = CLHEP::HepSymMatrix(6,0);
344 GradL = CLHEP::HepVector(6,0);
345 HessL = CLHEP::HepSymMatrix(6,0);
348 TDirectory * dirsave = gDirectory;
351 const bool oldAddDir = TH1::AddDirectoryStatus();
353 TH1::AddDirectory(
true);
357 TH1::AddDirectory(oldAddDir);
370 for(
int i=0;
i<=2;
i++)
371 for(
int j=0;
j<=2;
j++){
374 bool ierr = !InfI.Invert();
375 if( ierr ) {
if(alarm)
376 std::cout<<
" Error inverse Inf matrix !!!!!!!!!!!"<<std::endl;}
378 for(
int i=0;
i<=2;
i++)
379 for(
int k=0;
k<=2;
k++) d(
i) -= InfI(
i,
k)*
Gfr(
k);
383 CLHEP::HepVector d3 = CLHEP::solve(
Hess, -
Grad);
385 CLHEP::HepMatrix Errd3 =
Hess.inverse(iEr3);
386 if( iEr3 != 0) {
if(alarm)
387 std::cout<<
" endJob Error inverse Hess matrix !!!!!!!!!!!"<<std::endl;
392 CLHEP::HepVector dLI = CLHEP::solve(
HessL, -
GradL);
394 CLHEP::HepMatrix ErrdLI =
HessL.inverse(iErI);
395 if( iErI != 0) {
if(alarm)
396 std::cout<<
" endJob Error inverse HessL matrix !!!!!!!!!!!"<<std::endl;
413 std::cout<<
" dG "<<d3(1)<<
" "<<d3(2)<<
" "<<d3(3)<<
" "<<d3(4)<<
" "
414 <<d3(5)<<
" "<<d3(6)<<std::endl;;
416 <<
" "<<
sqrt(Errd3(4,4))<<
" "<<
sqrt(Errd3(5,5))<<
" "<<
sqrt(Errd3(6,6))
418 std::cout<<
" dL "<<dLI(1)<<
" "<<dLI(2)<<
" "<<dLI(3)<<
" "<<dLI(4)<<
" "
419 <<dLI(5)<<
" "<<dLI(6)<<std::endl;;
421 <<
" "<<
sqrt(ErrdLI(4,4))<<
" "<<
sqrt(ErrdLI(5,5))<<
" "<<
sqrt(ErrdLI(6,6))
425 CLHEP::HepVector vectorToDb(6,0), vectorErrToDb(6,0);
429 for(
unsigned int i=1;
i<=6;
i++) vectorErrToDb(
i) =
sqrt(ErrdLI(
i,
i));
439 OutGlobalTxt<<vectorToDb(1)<<
" "<<vectorToDb(2)<<
" "<<vectorToDb(3)<<
" "<<vectorToDb(4)<<
" "
440 <<vectorToDb(5)<<
" "<<vectorToDb(6)<<
" muon Global.\n";
441 OutGlobalTxt<<vectorErrToDb(1)<<
" "<<vectorErrToDb(1)<<
" "<<vectorErrToDb(1)<<
" "
442 <<vectorErrToDb(1)<<
" "<<vectorErrToDb(1)<<
" "<<vectorErrToDb(1)<<
" errors.\n";
449 std::cout<<
" Write to the file outglobal.txt done "<<std::endl;
462 double PI = 3.1415927;
463 histo =
new TH1F(
"Pt",
"pt",1000,0,100);
464 histo2 =
new TH1F(
"P",
"P [GeV/c]",400,0.,400.);
465 histo2->GetXaxis()->SetTitle(
"momentum [GeV/c]");
466 histo3 =
new TH1F(
"outerLambda",
"#lambda outer",100,-PI/2.,PI/2.);
467 histo3->GetXaxis()->SetTitle(
"#lambda outer");
468 histo4 =
new TH1F(
"phi",
"#phi [rad]",100,-PI,PI);
469 histo4->GetXaxis()->SetTitle(
"#phi [rad]");
470 histo5 =
new TH1F(
"Rmuon",
"inner muon hit R [cm]",100,0.,800.);
471 histo5->GetXaxis()->SetTitle(
"R of muon [cm]");
472 histo6 =
new TH1F(
"Zmuon",
"inner muon hit Z[cm]",100,-1000.,1000.);
473 histo6->GetXaxis()->SetTitle(
"Z of muon [cm]");
474 histo7 =
new TH1F(
"(Pm-Pt)/Pt",
" (Pmuon-Ptrack)/Ptrack", 100,-2.,2.);
475 histo7->GetXaxis()->SetTitle(
"(Pmuon-Ptrack)/Ptrack");
476 histo8 =
new TH1F(
"chi muon-track",
"#chi^{2}(muon-track)", 1000,0.,1000.);
477 histo8->GetXaxis()->SetTitle(
"#chi^{2} of muon w.r.t. propagated track");
478 histo11 =
new TH1F(
"distance muon-track",
"distance muon w.r.t track [cm]",100,0.,30.);
479 histo11->GetXaxis()->SetTitle(
"distance of muon w.r.t. track [cm]");
480 histo12 =
new TH1F(
"Xmuon-Xtrack",
"Xmuon-Xtrack [cm]",200,-20.,20.);
481 histo12->GetXaxis()->SetTitle(
"Xmuon - Xtrack [cm]");
482 histo13 =
new TH1F(
"Ymuon-Ytrack",
"Ymuon-Ytrack [cm]",200,-20.,20.);
483 histo13->GetXaxis()->SetTitle(
"Ymuon - Ytrack [cm]");
484 histo14 =
new TH1F(
"Zmuon-Ztrack",
"Zmuon-Ztrack [cm]",200,-20.,20.);
485 histo14->GetXaxis()->SetTitle(
"Zmuon-Ztrack [cm]");
486 histo15 =
new TH1F(
"NXmuon-NXtrack",
"NXmuon-NXtrack [rad]",200,-.1,.1);
487 histo15->GetXaxis()->SetTitle(
"N_{X}(muon)-N_{X}(track) [rad]");
488 histo16 =
new TH1F(
"NYmuon-NYtrack",
"NYmuon-NYtrack [rad]",200,-.1,.1);
489 histo16->GetXaxis()->SetTitle(
"N_{Y}(muon)-N_{Y}(track) [rad]");
490 histo17 =
new TH1F(
"NZmuon-NZtrack",
"NZmuon-NZtrack [rad]",200,-.1,.1);
491 histo17->GetXaxis()->SetTitle(
"N_{Z}(muon)-N_{Z}(track) [rad]");
492 histo18 =
new TH1F(
"expected error of Xinner",
"outer hit of inner tracker",100,0,.01);
493 histo18->GetXaxis()->SetTitle(
"expected error of Xinner [cm]");
494 histo19 =
new TH1F(
"expected error of Xmuon",
"inner hit of muon",100,0,.1);
495 histo19->GetXaxis()->SetTitle(
"expected error of Xmuon [cm]");
496 histo20 =
new TH1F(
"expected error of Xmuon-Xtrack",
"muon w.r.t. propagated track",100,0.,10.);
497 histo20->GetXaxis()->SetTitle(
"expected error of Xmuon-Xtrack [cm]");
498 histo21 =
new TH1F(
"pull of Xmuon-Xtrack",
"pull of Xmuon-Xtrack",100,-10.,10.);
499 histo21->GetXaxis()->SetTitle(
"(Xmuon-Xtrack)/expected error");
500 histo22 =
new TH1F(
"pull of Ymuon-Ytrack",
"pull of Ymuon-Ytrack",100,-10.,10.);
501 histo22->GetXaxis()->SetTitle(
"(Ymuon-Ytrack)/expected error");
502 histo23 =
new TH1F(
"pull of Zmuon-Ztrack",
"pull of Zmuon-Ztrack",100,-10.,10.);
503 histo23->GetXaxis()->SetTitle(
"(Zmuon-Ztrack)/expected error");
504 histo24 =
new TH1F(
"pull of PXmuon-PXtrack",
"pull of PXmuon-PXtrack",100,-10.,10.);
505 histo24->GetXaxis()->SetTitle(
"(P_{X}(muon)-P_{X}(track))/expected error");
506 histo25 =
new TH1F(
"pull of PYmuon-PYtrack",
"pull of PYmuon-PYtrack",100,-10.,10.);
507 histo25->GetXaxis()->SetTitle(
"(P_{Y}(muon)-P_{Y}(track))/expected error");
508 histo26 =
new TH1F(
"pull of PZmuon-PZtrack",
"pull of PZmuon-PZtrack",100,-10.,10.);
509 histo26->GetXaxis()->SetTitle(
"(P_{Z}(muon)-P_{Z}(track))/expected error");
510 histo27 =
new TH1F(
"N_x",
"Nx of tangent plane",120,-1.1,1.1);
511 histo27->GetXaxis()->SetTitle(
"normal vector projection N_{X}");
512 histo28 =
new TH1F(
"N_y",
"Ny of tangent plane",120,-1.1,1.1);
513 histo28->GetXaxis()->SetTitle(
"normal vector projection N_{Y}");
514 histo29 =
new TH1F(
"lenght of track",
"lenght of track",200,0.,400);
515 histo29->GetXaxis()->SetTitle(
"lenght of track [cm]");
516 histo30 =
new TH1F(
"lenght of muon",
"lenght of muon",200,0.,800);
517 histo30->GetXaxis()->SetTitle(
"lenght of muon [cm]");
519 histo31 =
new TH1F(
"local chi muon-track",
"#local chi^{2}(muon-track)", 1000,0.,1000.);
520 histo31->GetXaxis()->SetTitle(
"#local chi^{2} of muon w.r.t. propagated track");
521 histo32 =
new TH1F(
"pull of Px/Pz local",
"pull of Px/Pz local",100,-10.,10.);
522 histo32->GetXaxis()->SetTitle(
"local (Px/Pz(muon) - Px/Pz(track))/expected error");
523 histo33 =
new TH1F(
"pull of Py/Pz local",
"pull of Py/Pz local",100,-10.,10.);
524 histo33->GetXaxis()->SetTitle(
"local (Py/Pz(muon) - Py/Pz(track))/expected error");
525 histo34 =
new TH1F(
"pull of X local",
"pull of X local",100,-10.,10.);
526 histo34->GetXaxis()->SetTitle(
"local (Xmuon - Xtrack)/expected error");
527 histo35 =
new TH1F(
"pull of Y local",
"pull of Y local",100,-10.,10.);
528 histo35->GetXaxis()->SetTitle(
"local (Ymuon - Ytrack)/expected error");
530 histo101 =
new TH2F(
"Rtr/mu vs Ztr/mu",
"hit of track/muon",100,-800.,800.,100,0.,600.);
531 histo101->GetXaxis()->SetTitle(
"Z of track/muon [cm]");
532 histo101->GetYaxis()->SetTitle(
"R of track/muon [cm]");
533 histo102 =
new TH2F(
"Ytr/mu vs Xtr/mu",
"hit of track/muon",100,-600.,600.,100,-600.,600.);
534 histo102->GetXaxis()->SetTitle(
"X of track/muon [cm]");
535 histo102->GetYaxis()->SetTitle(
"Y of track/muon [cm]");
568 using namespace reco;
573 double PI = 3.1415927;
575 cosmicMuonMode_ =
true;
576 isolatedMuonMode_ = !cosmicMuonMode_;
582 if (
info || debug_) {
583 std::cout <<
"----- event " << N_event <<
" -- tracks "<<N_track<<
" ---";
584 if (cosmicMuonMode_)
std::cout <<
" treated as CosmicMu ";
585 if (isolatedMuonMode_)
std::cout <<
" treated as IsolatedMu ";
594 if (collectionIsolated){
597 iEvent.
getByLabel(
"ALCARECOMuAlCalIsolatedMu",
"GlobalMuon", gmuons);
598 iEvent.
getByLabel(
"ALCARECOMuAlCalIsolatedMu",
"SelectedMuons", smuons);
600 else if (collectionCosmic){
603 iEvent.
getByLabel(
"ALCARECOMuAlGlobalCosmics",
"GlobalMuon", gmuons);
604 iEvent.
getByLabel(
"ALCARECOMuAlGlobalCosmics",
"SelectedMuons", smuons);
615 <<
" runN " << (int)iEvent.
run() <<std::endl;
617 <<
" "<<gmuons->size() <<
" " << smuons->size() << std::endl;
618 for (MuonCollection::const_iterator itMuon = smuons->begin();
619 itMuon != smuons->end();
621 std::cout <<
" is isolatValid Matches " << itMuon->isIsolationValid()
622 <<
" " <<itMuon->isMatchesValid() << std::endl;
626 if (isolatedMuonMode_) {
627 if (
tracks->size() != 1)
return;
628 if (
muons->size() != 1)
return;
629 if (gmuons->size() != 1)
return;
630 if (smuons->size() != 1)
return;
633 if (cosmicMuonMode_){
634 if (smuons->size() > 2)
return;
635 if (
tracks->size() != smuons->size())
return;
636 if (
muons->size() != smuons->size())
return;
637 if (gmuons->size() != smuons->size())
return;
650 if (watchTrackingGeometry_.check(iSetup) || !trackingGeometry_) {
653 trackingGeometry_ = &*trackingGeometry;
656 if (watchMagneticFieldRecord_.check(iSetup) || !magneticField_) {
659 magneticField_ = &*magneticField;
662 if (watchGlobalPositionRcd_.check(iSetup) || !globalPositionRcd_) {
665 globalPositionRcd_ = &*globalPositionRcd;
666 for (std::vector<AlignTransform>::const_iterator
i
667 = globalPositionRcd_->m_align.begin();
668 i != globalPositionRcd_->m_align.end(); ++
i){
675 std::cout <<
"=== iteratorMuonRcd " << iteratorMuonRcd->rawId()<<
" ====\n"
676 <<
" translation " << iteratorMuonRcd->translation()<<
"\n"
677 <<
" angles " << iteratorMuonRcd->rotation().eulerAngles() << std::endl;
678 std::cout << iteratorMuonRcd->rotation() << std::endl;
704 for(MuonCollection::const_iterator itMuon = smuons->begin();
705 itMuon != smuons->end(); ++itMuon) {
708 std::cout<<
" mu gM is GM Mu SaM tM "<<itMuon->isGlobalMuon()<<
" "
709 <<itMuon->isMuon()<<
" "<<itMuon->isStandAloneMuon()
710 <<
" "<<itMuon->isTrackerMuon()<<
" "
715 TransientTrack muTT(itMuon->outerTrack(), magneticField_, trackingGeometry_);
720 TransientTrack trackTT(itMuon->track(), magneticField_, trackingGeometry_);
725 GlobalPoint pointTrackOut = outerTrackTSOS.globalPosition();
726 float lenghtTrack = (pointTrackOut-pointTrackIn).
mag();
727 GlobalPoint pointMuonIn = innerMuTSOS.globalPosition();
729 float lenghtMuon = (pointMuonOut - pointMuonIn).
mag();
730 GlobalVector momentumTrackOut = outerTrackTSOS.globalMomentum();
732 float distanceInIn = (pointTrackIn - pointMuonIn).
mag();
733 float distanceInOut = (pointTrackIn - pointMuonOut).
mag();
734 float distanceOutIn = (pointTrackOut - pointMuonIn).
mag();
735 float distanceOutOut = (pointTrackOut - pointMuonOut).
mag();
738 std::cout<<
" pointTrackIn "<<pointTrackIn<<std::endl;
739 std::cout<<
" Out "<<pointTrackOut<<
" lenght "<<lenghtTrack<<std::endl;
740 std::cout<<
" point MuonIn "<<pointMuonIn<<std::endl;
741 std::cout<<
" Out "<<pointMuonOut<<
" lenght "<<lenghtMuon<<std::endl;
742 std::cout<<
" momeTrackIn Out "<<momentumTrackIn<<
" "<<momentumTrackOut<<std::endl;
743 std::cout<<
" doi io ii oo "<<distanceOutIn<<
" "<<distanceInOut<<
" "
744 <<distanceInIn<<
" "<<distanceOutOut<<std::endl;
747 if(lenghtTrack < 90.)
continue;
748 if(lenghtMuon < 300.)
continue;
749 if(momentumTrackIn.
mag() < 15. || momentumTrackOut.
mag() < 15.)
continue;
750 if(trackTT.charge() != muTT.charge())
continue;
753 std::cout<<
" passed lenght momentum cuts"<<std::endl;
761 if( isolatedMuonMode_ ){
762 const Surface& refSurface = innerMuTSOS.surface();
764 tpMuLocal(refSurface.
tangentPlane(innerMuTSOS.localPosition()));
765 Nl = tpMuLocal->normalVector();
767 tpMuGlobal(refSurface.
tangentPlane(innerMuTSOS.globalPosition()));
770 const Plane* refPlane =
dynamic_cast<Plane*
>(surf);
774 std::cout<<
" Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
775 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
776 std::cout<<
" global "<<Ng.
x()<<
" "<<Ng.
y()<<
" "<<Ng.
z()<<std::endl;
777 std::cout<<
" lp "<<Nlp.
x()<<
" "<<Nlp.
y()<<
" "<<Nlp.
z()<<std::endl;
784 extrapolationT = alongSmPr.propagate(outerTrackTSOS, refSurface);
789 std::cout<<
" !!!!!!!!! Catastrophe Out-In extrapolationT.isValid "
802 (innerMuTSOS.globalPosition()).
y(),
803 (innerMuTSOS.globalPosition()).
z());
804 GPm = innerMuTSOS.globalMomentum();
806 (outerTrackTSOS.globalPosition()).
y(),
807 (outerTrackTSOS.globalPosition()).
z());
809 innerMuTSOS.cartesianError().matrix());
817 if( cosmicMuonMode_ ){
819 if((distanceOutIn <= distanceInOut) & (distanceOutIn <= distanceInIn) &
820 (distanceOutIn <= distanceOutOut)){
821 if(debug_)
std::cout<<
" ----- Out - In -----"<<std::endl;
823 const Surface& refSurface = innerMuTSOS.surface();
825 tpMuGlobal(refSurface.
tangentPlane(innerMuTSOS.globalPosition()));
826 Nl = tpMuGlobal->normalVector();
829 extrapolationT = alongSmPr.propagate(outerTrackTSOS, refSurface);
834 std::cout<<
" !!!!!!!!! Catastrophe Out-In extrapolationT.isValid "
850 (innerMuTSOS.globalPosition()).
y(),
851 (innerMuTSOS.globalPosition()).
z());
852 GPm = innerMuTSOS.globalMomentum();
854 (outerTrackTSOS.globalPosition()).
y(),
855 (outerTrackTSOS.globalPosition()).
z());
857 innerMuTSOS.cartesianError().matrix());
866 <<Chooser.operator()(*outerTrackTSOS.freeState(), refSurface)
868 Chooser.operator()(*outerTrackTSOS.freeState(), refSurface))
870 std::cout<<
" --- Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
871 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
876 else if((distanceInOut <= distanceInIn) & (distanceInOut <= distanceOutIn) &
877 (distanceInOut <= distanceOutOut)){
878 if(debug_)
std::cout<<
" ----- In - Out -----"<<std::endl;
883 Nl = tpMuGlobal->normalVector();
886 extrapolationT = oppositeSmPr.propagate(innerTrackTSOS, refSurface);
890 std::cout<<
" !!!!!!!!! Catastrophe Out-In extrapolationT.isValid "
891 <<
"\a\a\a\a\a\a\a\a"<<extrapolationT.
isValid()
922 <<Chooser.operator()(*innerTrackTSOS.
freeState(), refSurface)
924 Chooser.operator()(*innerTrackTSOS.
freeState(), refSurface))
926 std::cout<<
" --- Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
927 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
931 else if((distanceOutOut <= distanceInOut) & (distanceOutOut <= distanceInIn) &
932 (distanceOutOut <= distanceOutIn)){
933 if(debug_)
std::cout<<
" ----- Out - Out -----"<<std::endl;
941 Nl = tpMuGlobal->normalVector();
944 extrapolationT = alongSmPr.propagate(outerTrackTSOS, refSurface);
948 std::cout<<
" !!!!!!!!! Catastrophe Out-Out extrapolationT.isValid "
949 <<
"\a\a\a\a\a\a\a\a"<<extrapolationT.
isValid()
968 (outerTrackTSOS.globalPosition()).
y(),
969 (outerTrackTSOS.globalPosition()).
z());
979 <<Chooser.operator()(*outerTrackTSOS.freeState(), refSurface)
981 Chooser.operator()(*outerTrackTSOS.freeState(), refSurface))
983 std::cout<<
" --- Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
984 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
985 std::cout<<
" Nornal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
986 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
991 std::cout<<
" ------- !!!!!!!!!!!!!!! No proper Out - In \a\a\a\a\a\a\a"<<std::endl;
997 if(tsosMuonIf == 0) {
if(
info) {
std::cout<<
"No tsosMuon !!!!!!"<<std::endl;
continue;}}
999 if(tsosMuonIf == 1) tsosMuon = muTT.innermostMeasurementState();
1000 else tsosMuon = muTT.outermostMeasurementState();
1005 (GRm, GPm, Nl, Rt, Rm, Pm, LPRm, extrapolationT, tsosMuon);
1010 float RelMomResidual = (Pm.
mag() - Pt.mag()) / (Pt.mag() + 1.e-6);;
1013 Vm(0) = resR.
x(); Vm(1) = resR.
y(); Vm(2) = resR.
z();
1014 Vm(3) = resP0.
x(); Vm(4) = resP0.
y(); Vm(5) = resP0.
z();
1015 float Rmuon = Rm.
perp();
1016 float Zmuon = Rm.
z();
1017 float alfa_x = atan2(Nl.
x(),Nl.
y())*57.29578;
1020 std::cout<<
" Nx Ny Nz alfa_x "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "<<alfa_x<<std::endl;
1026 for(
int i=0;
i<=5;
i++) chi_d += Vm(
i)*Vm(
i)/Cm(
i,
i);
1032 bool ierrLoc = !
m.Invert();
1033 if (ierrLoc && debug_ &&
info) {
1036 double chi_Loc = ROOT::Math::Similarity(Vml,
m);
1038 std::cout<<
" chi_Loc px/pz/err "<<chi_Loc<<
" "<<Vml(1)/
sqrt(Cml(1,1))<<std::endl;
1040 if(Pt.mag() < 15.)
continue;
1041 if(Pm.
mag() < 5.)
continue;
1085 if(Rmuon < 120. || Rmuon > 450.)
continue;
1086 if(Zmuon < -720. || Zmuon > 720.)
continue;
1087 MuSelect =
" Barrel+EndCaps";
1091 std::cout<<
" .............. passed all cuts"<<std::endl;
1099 CLHEP::HepSymMatrix covLoc(4,0);
1100 for(
int i=1;
i<=4;
i++)
1101 for(
int j=1;
j<=
i;
j++){
1108 CLHEP::HepMatrix rotLoc (3,3,0);
1121 CLHEP::HepVector posLoc(3);
1130 std::cout<<
" posLoc "<<posLoc.T()<<std::endl;
1131 std::cout<<
" rotLoc "<<rotLoc<<std::endl;
1135 histo->Fill(itMuon->track()->pt());
1138 histo2->Fill(Pt.mag());
1139 histo3->Fill((
PI/2.-itMuon->track()->outerTheta()));
1140 histo4->Fill(itMuon->track()->phi());
1141 histo5->Fill(Rmuon);
1142 histo6->Fill(Zmuon);
1143 histo7->Fill(RelMomResidual);
1145 histo8->Fill(chi_d);
1147 histo101->Fill(Zmuon, Rmuon);
1148 histo101->Fill(Rt0.
z(), Rt0.
perp());
1149 histo102->Fill(Rt0.
x(), Rt0.
y());
1150 histo102->Fill(Rm.
x(), Rm.
y());
1152 histo11->Fill(resR.
mag());
1153 if(fabs(Nl.
x()) < 0.98) histo12->Fill(resR.
x());
1154 if(fabs(Nl.
y()) < 0.98) histo13->Fill(resR.
y());
1155 if(fabs(Nl.
z()) < 0.98) histo14->Fill(resR.
z());
1156 histo15->Fill(resP.
x());
1157 histo16->Fill(resP.
y());
1158 histo17->Fill(resP.
z());
1160 if((fabs(Nl.
x()) < 0.98) && (fabs(Nl.
y()) < 0.98) &&(fabs(Nl.
z()) < 0.98))
1162 histo18->Fill(
sqrt(C0(0,0)));
1163 histo19->Fill(
sqrt(C1(0,0)));
1164 histo20->Fill(
sqrt(C1(0,0)+Ce(0,0)));
1166 if(fabs(Nl.
x()) < 0.98) histo21->Fill(Vm(0)/
sqrt(Cm(0,0)));
1167 if(fabs(Nl.
y()) < 0.98) histo22->Fill(Vm(1)/
sqrt(Cm(1,1)));
1168 if(fabs(Nl.
z()) < 0.98) histo23->Fill(Vm(2)/
sqrt(Cm(2,2)));
1169 histo24->Fill(Vm(3)/
sqrt(C1(3,3)+Ce(3,3)));
1170 histo25->Fill(Vm(4)/
sqrt(C1(4,4)+Ce(4,4)));
1171 histo26->Fill(Vm(5)/
sqrt(C1(5,5)+Ce(5,5)));
1172 histo27->Fill(Nl.
x());
1173 histo28->Fill(Nl.
y());
1174 histo29->Fill(lenghtTrack);
1175 histo30->Fill(lenghtMuon);
1176 histo31->Fill(chi_Loc);
1177 histo32->Fill(Vml(1)/
sqrt(Cml(1,1)));
1178 histo33->Fill(Vml(2)/
sqrt(Cml(2,2)));
1179 histo34->Fill(Vml(3)/
sqrt(Cml(3,3)));
1180 histo35->Fill(Vml(4)/
sqrt(Cml(4,4)));
1184 std::cout<<
" diag 0[ "<<C0(0,0)<<
" "<<C0(1,1)<<
" "<<C0(2,2)<<
" "<<C0(3,3)<<
" "
1185 <<C0(4,4)<<
" "<<C0(5,5)<<
" ]"<<std::endl;
1186 std::cout<<
" diag e[ "<<Ce(0,0)<<
" "<<Ce(1,1)<<
" "<<Ce(2,2)<<
" "<<Ce(3,3)<<
" "
1187 <<Ce(4,4)<<
" "<<Ce(5,5)<<
" ]"<<std::endl;
1188 std::cout<<
" diag 1[ "<<C1(0,0)<<
" "<<C1(1,1)<<
" "<<C1(2,2)<<
" "<<C1(3,3)<<
" "
1189 <<C1(4,4)<<
" "<<C1(5,5)<<
" ]"<<std::endl;
1191 <<
" Pm "<<Pm.
x()<<
" "<<Pm.
y()<<
" "<<Pm.
z()<<std::endl;
1192 std::cout<<
" Rt "<<Rt.x()<<
" "<<Rt.y()<<
" "<<Rt.z()
1193 <<
" Pt "<<Pt.x()<<
" "<<Pt.y()<<
" "<<Pt.z()<<std::endl;
1195 std::cout<<
" resR "<<resR.
x()<<
" "<<resR.
y()<<
" "<<resR.
z()
1196 <<
" resP "<<resP.
x()<<
" "<<resP.
y()<<
" "<<resP.
z()<<std::endl;
1197 std::cout<<
" Rm-t "<<(Rm-Rt).
x()<<
" "<<(Rm-Rt).
y()<<
" "<<(Rm-Rt).
z()
1198 <<
" Pm-t "<<(Pm-
Pt).
x()<<
" "<<(Pm-
Pt).
y()<<
" "<<(Pm-
Pt).
z()<<std::endl;
1201 <<
sqrt(Cm(3,3))<<
" "<<
sqrt(Cm(4,4))<<
" "<<
sqrt(Cm(5,5))<<std::endl;
1202 std::cout<<
" Pmuon Ptrack dP/Ptrack "<<itMuon->outerTrack()->p()<<
" "
1203 <<itMuon->track()->outerP()<<
" "
1204 <<(itMuon->outerTrack()->p() -
1205 itMuon->track()->outerP())/itMuon->track()->outerP()<<std::endl;
1208 std::cout<<
" diag [ "<<Cm(0,0)<<
" "<<Cm(1,1)<<
" "<<Cm(2,2)<<
" "<<Cm(3,3)<<
" "
1209 <<Cm(4,4)<<
" "<<Cm(5,5)<<
" ]"<<std::endl;
1213 for(
int i=0;
i<=5;
i++) Diag[
i] =
sqrt(Cm(
i,
i));
1214 for(
int i=0;
i<=5;
i++)
1215 for(
int j=0;
j<=5;
j++)
1216 Ro(
i,
j) = Cm(
i,
j)/Diag[
i]/Diag[
j];
1217 std::cout<<
" correlation matrix "<<std::endl;
1221 for(
int i=0;
i<=5;
i++)
1222 for(
int j=0;
j<=5;
j++)
1225 bool ierr = !CmI.Invert();
1226 if( ierr ) {
if(alarm || debug_)
1227 std::cout<<
" Error inverse covariance matrix !!!!!!!!!!!"<<std::endl;
1230 std::cout<<
" inverse cov matrix "<<std::endl;
1233 double chi = ROOT::Math::Similarity(Vm, CmI);
1234 std::cout<<
" chi chi_d "<<chi<<
" "<<chi_d<<std::endl;
1246 using namespace edm;
1247 using namespace reco;
1252 double PI = 3.1415927;
1255 cosmicMuonMode_ =
true;
1258 isolatedMuonMode_ = !cosmicMuonMode_;
1261 if (
info || debug_) {
1262 std::cout <<
"----- event " << N_event <<
" -- tracks "<<N_track<<
" ---";
1263 if (cosmicMuonMode_)
std::cout <<
" treated as CosmicMu ";
1264 if (isolatedMuonMode_)
std::cout <<
" treated as IsolatedMu ";
1273 if (collectionIsolated){
1276 iEvent.
getByLabel(
"ALCARECOMuAlCalIsolatedMu",
"GlobalMuon", gmuons);
1277 iEvent.
getByLabel(
"ALCARECOMuAlCalIsolatedMu",
"SelectedMuons", smuons);
1279 else if (collectionCosmic){
1282 iEvent.
getByLabel(
"ALCARECOMuAlGlobalCosmics",
"GlobalMuon", gmuons);
1283 iEvent.
getByLabel(
"ALCARECOMuAlGlobalCosmics",
"SelectedMuons", smuons);
1294 <<
" runN " << (int)iEvent.
run() <<std::endl;
1296 <<
" "<<gmuons->size() <<
" " << smuons->size() << std::endl;
1297 for (MuonCollection::const_iterator itMuon = smuons->begin();
1298 itMuon != smuons->end();
1300 std::cout <<
" is isolatValid Matches " << itMuon->isIsolationValid()
1301 <<
" " <<itMuon->isMatchesValid() << std::endl;
1305 if (isolatedMuonMode_) {
1306 if (
tracks->size() != 1)
return;
1307 if (
muons->size() != 1)
return;
1308 if (gmuons->size() != 1)
return;
1309 if (smuons->size() != 1)
return;
1312 if (cosmicMuonMode_){
1313 if (smuons->size() > 2)
return;
1314 if (
tracks->size() != smuons->size())
return;
1315 if (
muons->size() != smuons->size())
return;
1316 if (gmuons->size() != smuons->size())
return;
1329 if (watchTrackingGeometry_.check(iSetup) || !trackingGeometry_) {
1332 trackingGeometry_ = &*trackingGeometry;
1333 theTrackingGeometry = trackingGeometry;
1336 if (watchMagneticFieldRecord_.check(iSetup) || !magneticField_) {
1339 magneticField_ = &*magneticField;
1342 if (watchGlobalPositionRcd_.check(iSetup) || !globalPositionRcd_) {
1345 globalPositionRcd_ = &*globalPositionRcd;
1346 for (std::vector<AlignTransform>::const_iterator
i
1347 = globalPositionRcd_->m_align.begin();
1348 i != globalPositionRcd_->m_align.end(); ++
i){
1355 std::cout <<
"=== iteratorTrackerRcd " << iteratorTrackerRcd->rawId()<<
" ====\n"
1356 <<
" translation " << iteratorTrackerRcd->translation()<<
"\n"
1357 <<
" angles " << iteratorTrackerRcd->rotation().eulerAngles() << std::endl;
1358 std::cout << iteratorTrackerRcd->rotation() << std::endl;
1359 std::cout <<
"=== iteratorMuonRcd " << iteratorMuonRcd->rawId()<<
" ====\n"
1360 <<
" translation " << iteratorMuonRcd->translation()<<
"\n"
1361 <<
" angles " << iteratorMuonRcd->rotation().eulerAngles() << std::endl;
1362 std::cout << iteratorMuonRcd->rotation() << std::endl;
1388 std::cout<<
" ............... DEFINE FITTER ..................."<<std::endl;
1410 std::cout<<
" theTrackingGeometry.isValid() "<<theTrackingGeometry.isValid()<<std::endl;
1411 std::cout<<
"get also the MuonTransientTrackingRecHitBuilder" <<
"\n";
1412 std::cout<<
"get also the TransientTrackingRecHitBuilder" <<
"\n";
1414 defineFitter =
false;
1419 for(MuonCollection::const_iterator itMuon = smuons->begin();
1420 itMuon != smuons->end(); ++itMuon) {
1423 std::cout<<
" mu gM is GM Mu SaM tM "<<itMuon->isGlobalMuon()<<
" "
1424 <<itMuon->isMuon()<<
" "<<itMuon->isStandAloneMuon()
1425 <<
" "<<itMuon->isTrackerMuon()<<
" "
1430 TransientTrack muTT(itMuon->outerTrack(), magneticField_, trackingGeometry_);
1435 TransientTrack trackTT(itMuon->track(), magneticField_, trackingGeometry_);
1440 GlobalPoint pointTrackOut = outerTrackTSOS.globalPosition();
1441 float lenghtTrack = (pointTrackOut-pointTrackIn).
mag();
1442 GlobalPoint pointMuonIn = innerMuTSOS.globalPosition();
1444 float lenghtMuon = (pointMuonOut - pointMuonIn).
mag();
1445 GlobalVector momentumTrackOut = outerTrackTSOS.globalMomentum();
1447 float distanceInIn = (pointTrackIn - pointMuonIn).
mag();
1448 float distanceInOut = (pointTrackIn - pointMuonOut).
mag();
1449 float distanceOutIn = (pointTrackOut - pointMuonIn).
mag();
1450 float distanceOutOut = (pointTrackOut - pointMuonOut).
mag();
1453 std::cout<<
" pointTrackIn "<<pointTrackIn<<std::endl;
1454 std::cout<<
" Out "<<pointTrackOut<<
" lenght "<<lenghtTrack<<std::endl;
1455 std::cout<<
" point MuonIn "<<pointMuonIn<<std::endl;
1456 std::cout<<
" Out "<<pointMuonOut<<
" lenght "<<lenghtMuon<<std::endl;
1457 std::cout<<
" momeTrackIn Out "<<momentumTrackIn<<
" "<<momentumTrackOut<<std::endl;
1458 std::cout<<
" doi io ii oo "<<distanceOutIn<<
" "<<distanceInOut<<
" "
1459 <<distanceInIn<<
" "<<distanceOutOut<<std::endl;
1462 if(lenghtTrack < 90.)
continue;
1463 if(lenghtMuon < 300.)
continue;
1464 if(innerMuTSOS.globalMomentum().mag() < 5. || outerMuTSOS.
globalMomentum().
mag() < 5.)
continue;
1465 if(momentumTrackIn.
mag() < 15. || momentumTrackOut.
mag() < 15.)
continue;
1466 if(trackTT.charge() != muTT.charge())
continue;
1469 std::cout<<
" passed lenght momentum cuts"<<std::endl;
1481 if( isolatedMuonMode_ ){
1482 if(debug_)
std::cout<<
" ------ Isolated (out-in) ----- "<<std::endl;
1483 const Surface& refSurface = innerMuTSOS.surface();
1485 tpMuLocal(refSurface.
tangentPlane(innerMuTSOS.localPosition()));
1486 Nl = tpMuLocal->normalVector();
1488 tpMuGlobal(refSurface.
tangentPlane(innerMuTSOS.globalPosition()));
1491 const Plane* refPlane =
dynamic_cast<Plane*
>(surf);
1495 std::cout<<
" Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
1496 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
1497 std::cout<<
" global "<<Ng.
x()<<
" "<<Ng.
y()<<
" "<<Ng.
z()<<std::endl;
1498 std::cout<<
" lp "<<Nlp.
x()<<
" "<<Nlp.
y()<<
" "<<Nlp.
z()<<std::endl;
1508 extrapolationT = alongSmPr.propagate(outerTrackTSOS, refSurface);
1513 extrapolationT = alongSmPr.propagate(trackFittedTSOS, refSurface);
1516 if(!extrapolationT.
isValid()){
1518 std::cout<<
" !!!!!!!!! Catastrophe Out-In extrapolationT.isValid "
1531 (innerMuTSOS.globalPosition()).
y(),
1532 (innerMuTSOS.globalPosition()).
z());
1533 GPm = innerMuTSOS.globalMomentum();
1536 (outerTrackTSOS.globalPosition()).
y(),
1537 (outerTrackTSOS.globalPosition()).
z());
1539 innerMuTSOS.cartesianError().matrix());
1550 if( cosmicMuonMode_ ){
1552 if((distanceOutIn <= distanceInOut) & (distanceOutIn <= distanceInIn) &
1553 (distanceOutIn <= distanceOutOut)){
1554 if(debug_)
std::cout<<
" ----- Out - In -----"<<std::endl;
1556 const Surface& refSurface = innerMuTSOS.surface();
1558 tpMuGlobal(refSurface.
tangentPlane(innerMuTSOS.globalPosition()));
1559 Nl = tpMuGlobal->normalVector();
1564 extrapolationT = alongSmPr.propagate(outerTrackTSOS, refSurface);
1569 extrapolationT = alongSmPr.propagate(trackFittedTSOS, refSurface);
1572 if(!extrapolationT.
isValid()){
1574 std::cout<<
" !!!!!!!!! Catastrophe Out-In extrapolationT.isValid "
1580 std::cout<<
" extrapolationT.isValid "<<extrapolationT.
isValid()<<std::endl;
1590 (innerMuTSOS.globalPosition()).
y(),
1591 (innerMuTSOS.globalPosition()).
z());
1592 GPm = innerMuTSOS.globalMomentum();
1594 (outerTrackTSOS.globalPosition()).
y(),
1595 (outerTrackTSOS.globalPosition()).
z());
1597 innerMuTSOS.cartesianError().matrix());
1609 <<Chooser.operator()(*outerTrackTSOS.freeState(), refSurface)
1611 Chooser.operator()(*outerTrackTSOS.freeState(), refSurface))
1613 std::cout<<
" --- Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
1614 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
1619 else if((distanceInOut <= distanceInIn) & (distanceInOut <= distanceOutIn) &
1620 (distanceInOut <= distanceOutOut)){
1621 if(debug_)
std::cout<<
" ----- In - Out -----"<<std::endl;
1626 Nl = tpMuGlobal->normalVector();
1631 extrapolationT = oppositeSmPr.propagate(innerTrackTSOS, refSurface);
1636 extrapolationT = oppositeSmPr.propagate(trackFittedTSOS, refSurface);
1639 if(!extrapolationT.
isValid()){
1641 std::cout<<
" !!!!!!!!! Catastrophe Out-In extrapolationT.isValid "
1642 <<
"\a\a\a\a\a\a\a\a"<<extrapolationT.
isValid()
1647 std::cout<<
" extrapolationT.isValid "<<extrapolationT.
isValid()<<std::endl;
1676 <<Chooser.operator()(*innerTrackTSOS.
freeState(), refSurface)
1678 Chooser.operator()(*innerTrackTSOS.
freeState(), refSurface))
1680 std::cout<<
" --- Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
1681 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
1685 else if((distanceOutOut <= distanceInOut) & (distanceOutOut <= distanceInIn) &
1686 (distanceOutOut <= distanceOutIn)){
1687 if(debug_)
std::cout<<
" ----- Out - Out -----"<<std::endl;
1695 Nl = tpMuGlobal->normalVector();
1698 extrapolationT = alongSmPr.propagate(outerTrackTSOS, refSurface);
1700 if(!extrapolationT.
isValid()){
1702 std::cout<<
" !!!!!!!!! Catastrophe Out-Out extrapolationT.isValid "
1703 <<
"\a\a\a\a\a\a\a\a"<<extrapolationT.
isValid()
1708 std::cout<<
" extrapolationT.isValid "<<extrapolationT.
isValid()<<std::endl;
1722 (outerTrackTSOS.globalPosition()).
y(),
1723 (outerTrackTSOS.globalPosition()).
z());
1733 <<Chooser.operator()(*outerTrackTSOS.freeState(), refSurface)
1735 Chooser.operator()(*outerTrackTSOS.freeState(), refSurface))
1737 std::cout<<
" --- Nlocal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
1738 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
1739 std::cout<<
" Nornal "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "
1740 <<
" alfa "<<int(asin(Nl.
x())*57.29578)<<std::endl;
1745 std::cout<<
" ------- !!!!!!!!!!!!!!! No proper Out - In \a\a\a\a\a\a\a"<<std::endl;
1751 if(tsosMuonIf == 0) {
if(
info) {
std::cout<<
"No tsosMuon !!!!!!"<<std::endl;
continue;}}
1753 if(tsosMuonIf == 1) tsosMuon = muTT.innermostMeasurementState();
1754 else tsosMuon = muTT.outermostMeasurementState();
1759 (GRm, GPm, Nl, Rt, Rm, Pm, LPRm, extrapolationT, tsosMuon);
1762 if(!trackFittedTSOS.
isValid()){
1763 if(
info)
std::cout<<
" ================= trackFittedTSOS notValid !!!!!!!! "<<std::endl;
1765 if(debug_) this->debugTrajectorySOS(
" trackFittedTSOS ", trackFittedTSOS);
1769 if(!muonFittedTSOS.
isValid()){
1770 if(
info)
std::cout<<
" ================= muonFittedTSOS notValid !!!!!!!! "<<std::endl;
1772 if(debug_) this->debugTrajectorySOS(
" muonFittedTSOS ", muonFittedTSOS);
1785 float RelMomResidual = (Pm.
mag() - Pt.mag()) / (Pt.mag() + 1.e-6);;
1788 Vm(0) = resR.
x(); Vm(1) = resR.
y(); Vm(2) = resR.
z();
1789 Vm(3) = resP0.
x(); Vm(4) = resP0.
y(); Vm(5) = resP0.
z();
1790 float Rmuon = Rm.
perp();
1791 float Zmuon = Rm.
z();
1792 float alfa_x = atan2(Nl.
x(),Nl.
y())*57.29578;
1795 std::cout<<
" Nx Ny Nz alfa_x "<<Nl.
x()<<
" "<<Nl.
y()<<
" "<<Nl.
z()<<
" "<<alfa_x<<std::endl;
1801 for(
int i=0;
i<=5;
i++) chi_d += Vm(
i)*Vm(
i)/Cm(
i,
i);
1807 bool ierrLoc = !
m.Invert();
1808 if (ierrLoc && debug_ &&
info) {
1811 double chi_Loc = ROOT::Math::Similarity(Vml,
m);
1813 std::cout<<
" chi_Loc px/pz/err "<<chi_Loc<<
" "<<Vml(1)/
sqrt(Cml(1,1))<<std::endl;
1815 if(Pt.mag() < 15.)
continue;
1816 if(Pm.
mag() < 5.)
continue;
1831 if(fabs(resR.
x()) > 20.)
continue;
1832 if(fabs(resR.
y()) > 20.)
continue;
1833 if(fabs(resR.
z()) > 20.)
continue;
1834 if(fabs(resR.
mag()) > 30.)
continue;
1835 if(fabs(resP.
x()) > 0.06)
continue;
1836 if(fabs(resP.
y()) > 0.06)
continue;
1837 if(fabs(resP.
z()) > 0.06)
continue;
1838 if(chi_d > 40.)
continue;
1858 if(Rmuon < 120. || Rmuon > 450.)
continue;
1859 if(Zmuon < -720. || Zmuon > 720.)
continue;
1860 MuSelect =
" Barrel+EndCaps";
1863 std::cout<<
" .............. passed all cuts"<<std::endl;
1871 CLHEP::HepSymMatrix covLoc(4,0);
1872 for(
int i=1;
i<=4;
i++)
1873 for(
int j=1;
j<=
i;
j++){
1880 CLHEP::HepMatrix rotLoc (3,3,0);
1893 CLHEP::HepVector posLoc(3);
1902 std::cout<<
" posLoc "<<posLoc.T()<<std::endl;
1903 std::cout<<
" rotLoc "<<rotLoc<<std::endl;
1907 histo->Fill(itMuon->track()->pt());
1910 histo2->Fill(Pt.mag());
1911 histo3->Fill((
PI/2.-itMuon->track()->outerTheta()));
1912 histo4->Fill(itMuon->track()->phi());
1913 histo5->Fill(Rmuon);
1914 histo6->Fill(Zmuon);
1915 histo7->Fill(RelMomResidual);
1917 histo8->Fill(chi_d);
1919 histo101->Fill(Zmuon, Rmuon);
1920 histo101->Fill(Rt0.
z(), Rt0.
perp());
1921 histo102->Fill(Rt0.
x(), Rt0.
y());
1922 histo102->Fill(Rm.
x(), Rm.
y());
1924 histo11->Fill(resR.
mag());
1925 if(fabs(Nl.
x()) < 0.98) histo12->Fill(resR.
x());
1926 if(fabs(Nl.
y()) < 0.98) histo13->Fill(resR.
y());
1927 if(fabs(Nl.
z()) < 0.98) histo14->Fill(resR.
z());
1928 histo15->Fill(resP.
x());
1929 histo16->Fill(resP.
y());
1930 histo17->Fill(resP.
z());
1932 if((fabs(Nl.
x()) < 0.98) && (fabs(Nl.
y()) < 0.98) &&(fabs(Nl.
z()) < 0.98))
1934 histo18->Fill(
sqrt(C0(0,0)));
1935 histo19->Fill(
sqrt(C1(0,0)));
1936 histo20->Fill(
sqrt(C1(0,0)+Ce(0,0)));
1938 if(fabs(Nl.
x()) < 0.98) histo21->Fill(Vm(0)/
sqrt(Cm(0,0)));
1939 if(fabs(Nl.
y()) < 0.98) histo22->Fill(Vm(1)/
sqrt(Cm(1,1)));
1940 if(fabs(Nl.
z()) < 0.98) histo23->Fill(Vm(2)/
sqrt(Cm(2,2)));
1941 histo24->Fill(Vm(3)/
sqrt(C1(3,3)+Ce(3,3)));
1942 histo25->Fill(Vm(4)/
sqrt(C1(4,4)+Ce(4,4)));
1943 histo26->Fill(Vm(5)/
sqrt(C1(5,5)+Ce(5,5)));
1944 histo27->Fill(Nl.
x());
1945 histo28->Fill(Nl.
y());
1946 histo29->Fill(lenghtTrack);
1947 histo30->Fill(lenghtMuon);
1948 histo31->Fill(chi_Loc);
1949 histo32->Fill(Vml(1)/
sqrt(Cml(1,1)));
1950 histo33->Fill(Vml(2)/
sqrt(Cml(2,2)));
1951 histo34->Fill(Vml(3)/
sqrt(Cml(3,3)));
1952 histo35->Fill(Vml(4)/
sqrt(Cml(4,4)));
1956 std::cout<<
" diag 0[ "<<C0(0,0)<<
" "<<C0(1,1)<<
" "<<C0(2,2)<<
" "<<C0(3,3)<<
" "
1957 <<C0(4,4)<<
" "<<C0(5,5)<<
" ]"<<std::endl;
1958 std::cout<<
" diag e[ "<<Ce(0,0)<<
" "<<Ce(1,1)<<
" "<<Ce(2,2)<<
" "<<Ce(3,3)<<
" "
1959 <<Ce(4,4)<<
" "<<Ce(5,5)<<
" ]"<<std::endl;
1960 std::cout<<
" diag 1[ "<<C1(0,0)<<
" "<<C1(1,1)<<
" "<<C1(2,2)<<
" "<<C1(3,3)<<
" "
1961 <<C1(4,4)<<
" "<<C1(5,5)<<
" ]"<<std::endl;
1963 <<
" Pm "<<Pm.
x()<<
" "<<Pm.
y()<<
" "<<Pm.
z()<<std::endl;
1964 std::cout<<
" Rt "<<Rt.x()<<
" "<<Rt.y()<<
" "<<Rt.z()
1965 <<
" Pt "<<Pt.x()<<
" "<<Pt.y()<<
" "<<Pt.z()<<std::endl;
1967 std::cout<<
" resR "<<resR.
x()<<
" "<<resR.
y()<<
" "<<resR.
z()
1968 <<
" resP "<<resP.
x()<<
" "<<resP.
y()<<
" "<<resP.
z()<<std::endl;
1969 std::cout<<
" Rm-t "<<(Rm-Rt).
x()<<
" "<<(Rm-Rt).
y()<<
" "<<(Rm-Rt).
z()
1970 <<
" Pm-t "<<(Pm-
Pt).
x()<<
" "<<(Pm-
Pt).
y()<<
" "<<(Pm-
Pt).
z()<<std::endl;
1973 <<
sqrt(Cm(3,3))<<
" "<<
sqrt(Cm(4,4))<<
" "<<
sqrt(Cm(5,5))<<std::endl;
1974 std::cout<<
" Pmuon Ptrack dP/Ptrack "<<itMuon->outerTrack()->p()<<
" "
1975 <<itMuon->track()->outerP()<<
" "
1976 <<(itMuon->outerTrack()->p() -
1977 itMuon->track()->outerP())/itMuon->track()->outerP()<<std::endl;
1980 std::cout<<
" diag [ "<<Cm(0,0)<<
" "<<Cm(1,1)<<
" "<<Cm(2,2)<<
" "<<Cm(3,3)<<
" "
1981 <<Cm(4,4)<<
" "<<Cm(5,5)<<
" ]"<<std::endl;
1985 for(
int i=0;
i<=5;
i++) Diag[
i] =
sqrt(Cm(
i,
i));
1986 for(
int i=0;
i<=5;
i++)
1987 for(
int j=0;
j<=5;
j++)
1988 Ro(
i,
j) = Cm(
i,
j)/Diag[
i]/Diag[
j];
1989 std::cout<<
" correlation matrix "<<std::endl;
1993 for(
int i=0;
i<=5;
i++)
1994 for(
int j=0;
j<=5;
j++)
1997 bool ierr = !CmI.Invert();
1998 if( ierr ) {
if(alarm || debug_)
1999 std::cout<<
" Error inverse covariance matrix !!!!!!!!!!!"<<std::endl;
2002 std::cout<<
" inverse cov matrix "<<std::endl;
2005 double chi = ROOT::Math::Similarity(Vm, CmI);
2006 std::cout<<
" chi chi_d "<<chi<<
" "<<chi_d<<std::endl;
2026 R_m(0) = Rm.
x(); R_m(1) = Rm.
y(); R_m(2) = Rm.
z();
2027 R_t(0) = Rt.
x(); R_t(1) = Rt.
y(); R_t(2) = Rt.
z();
2028 P_t(0) = Pt.
x(); P_t(1) = Pt.
y(); P_t(2) = Pt.
z();
2029 Norm(0) = Nl.
x(); Norm(1) = Nl.
y(); Norm(2) = Nl.
z();
2031 for(
int i=0;
i<=2;
i++){
2032 if(Cm(
i,
i) > 1.
e-20)
2034 else Wi(
i) = 1.e-10;
2035 dR(
i) = R_m(
i) - R_t(
i);
2038 float PtN = P_t(0)*Norm(0) + P_t(1)*Norm(1) + P_t(2)*Norm(2);
2040 Jac(0,0) = 1. - P_t(0)*Norm(0)/PtN;
2041 Jac(0,1) = - P_t(0)*Norm(1)/PtN;
2042 Jac(0,2) = - P_t(0)*Norm(2)/PtN;
2044 Jac(1,0) = - P_t(1)*Norm(0)/PtN;
2045 Jac(1,1) = 1. - P_t(1)*Norm(1)/PtN;
2046 Jac(1,2) = - P_t(1)*Norm(2)/PtN;
2048 Jac(2,0) = - P_t(2)*Norm(0)/PtN;
2049 Jac(2,1) = - P_t(2)*Norm(1)/PtN;
2050 Jac(2,2) = 1. - P_t(2)*Norm(2)/PtN;
2054 for(
int i=0;
i<=2;
i++)
2055 for(
int j=0;
j<=2;
j++){
2059 for(
int k=0;
k<=2;
k++){
2062 for(
int i=0;
i<=2;
i++)
2063 for(
int j=0;
j<=2;
j++){
2068 for(
int i=0;
i<=2;
i++)
2069 for(
int k=0;
k<=2;
k++) Gtr(
i) +=
dR(
k)*Wi(
k)*Jac(
k,
i);
2070 for(
int i=0;
i<=2;
i++) Gfr(
i) += Gtr(
i);
2080 std::cout<<
" Jacobian dr/ddx "<<std::endl;
2110 CLHEP::HepSymMatrix
w(Nd,0);
2111 for (
int i=1;
i <= Nd;
i++)
2112 for (
int j=1;
j <= Nd;
j++){
2113 if(
j <=
i )
w(
i,
j) = GCov(
i-1,
j-1);
2116 if((
i ==
j) && (
i<=3) && (GCov(
i-1,
j-1) < 1.
e-20))
w(
i,
j) = 1.e20;
2117 if(
i !=
j)
w(
i,
j) = 0.;
2123 CLHEP::HepVector V(Nd), Rt(3),
Pt(3), Rm(3), Pm(3), Norm(3);
2124 Rt(1) = GRt.
x(); Rt(2) = GRt.
y(); Rt(3) = GRt.
z();
2125 Pt(1) = GPt.
x();
Pt(2) = GPt.
y();
Pt(3) = GPt.
z();
2126 Rm(1) = GRm.
x(); Rm(2) = GRm.
y(); Rm(3) = GRm.
z();
2127 Pm(1) = GPm.
x(); Pm(2) = GPm.
y(); Pm(3) = GPm.
z();
2128 Norm(1) = GNorm.
x(); Norm(2) = GNorm.
y(); Norm(3) = GNorm.
z();
2130 V = dsum(Rm - Rt, Pm -
Pt) ;
2133 double PmN = CLHEP_dot(Pm, Norm);
2135 CLHEP::HepMatrix Jac(Nd,Nd,0);
2136 for (
int i=1;
i <= 3;
i++)
2137 for (
int j=1;
j <= 3;
j++){
2138 Jac(
i,
j) = Pm(
i)*Norm(
j) / PmN;
2139 if(
i ==
j ) Jac(
i,
j) -= 1.;
2153 CLHEP::HepVector dsda(3);
2154 dsda(1) = (Norm(2)*Rm(3) - Norm(3)*Rm(2)) / PmN;
2155 dsda(2) = (Norm(3)*Rm(1) - Norm(1)*Rm(3)) / PmN;
2156 dsda(3) = (Norm(1)*Rm(2) - Norm(2)*Rm(1)) / PmN;
2159 Jac(1,4) = Pm(1)*dsda(1);
2160 Jac(2,4) = -Rm(3) + Pm(2)*dsda(1);
2161 Jac(3,4) = Rm(2) + Pm(3)*dsda(1);
2163 Jac(1,5) = Rm(3) + Pm(1)*dsda(2);
2164 Jac(2,5) = Pm(2)*dsda(2);
2165 Jac(3,5) = -Rm(1) + Pm(3)*dsda(2);
2167 Jac(1,6) = -Rm(2) + Pm(1)*dsda(3);
2168 Jac(2,6) = Rm(1) + Pm(2)*dsda(3);
2169 Jac(3,6) = Pm(3)*dsda(3);
2171 CLHEP::HepSymMatrix W(Nd,0);
2173 W = w.inverse(ierr);
2174 if(ierr != 0) {
if(alarm)
2175 std::cout<<
" gradientGlobal: inversion of matrix w fail "<<std::endl;
2179 CLHEP::HepMatrix W_Jac(Nd,Nd,0);
2180 W_Jac = Jac.T() * W;
2182 CLHEP::HepVector grad3(Nd);
2185 CLHEP::HepMatrix hess3(Nd,Nd);
2186 hess3 = Jac.T() * W * Jac;
2192 CLHEP::HepVector d3I = CLHEP::solve(Hess, -Grad);
2194 CLHEP::HepMatrix Errd3I = Hess.inverse(iEr3I);
2195 if( iEr3I != 0) {
if(alarm)
2196 std::cout<<
" gradientGlobal error inverse Hess matrix !!!!!!!!!!!"<<std::endl;
2200 std::cout<<
" dG "<<d3I(1)<<
" "<<d3I(2)<<
" "<<d3I(3)<<
" "<<d3I(4)<<
" "
2201 <<d3I(5)<<
" "<<d3I(6)<<std::endl;;
2203 <<
" "<<
sqrt(Errd3I(4,4))<<
" "<<
sqrt(Errd3I(5,5))<<
" "<<
sqrt(Errd3I(6,6))
2207 #ifdef CHECK_OF_DERIVATIVES
2210 CLHEP::HepVector d(3,0),
a(3,0);
2211 CLHEP::HepMatrix
T(3,3,1);
2213 CLHEP::HepMatrix Ti = T.T();
2216 double A = CLHEP_dot(Ti*Pm, Norm);
2217 double B = CLHEP_dot((Rt -Ti*Rm + Ti*d), Norm);
2220 CLHEP::HepVector r0(3,0), p0(3,0);
2221 r0 = Ti*Rm - Ti*d + s0*(Ti*Pm) - Rt;
2224 double delta = 0.0001;
2226 int ii = 3; d(ii) +=
delta;
2233 A = CLHEP_dot(Ti*Pm, Norm);
2234 B = CLHEP_dot((Rt -Ti*Rm + Ti*d), Norm);
2237 CLHEP::HepVector
r(3,0),
p(3,0);
2238 r = Ti*Rm - Ti*d + s*(Ti*Pm) - Rt;
2241 std::cout<<
" s0 s num dsda("<<ii<<
") "<<s0<<
" "<<s<<
" "
2242 <<(s-s0)/delta<<
" "<<dsda(ii)<<endl;
2244 std::cout<<
" -- An d(r,p)/d("<<ii<<
") "<<Jac(1,ii)<<
" "<<Jac(2,ii)<<
" "
2245 <<Jac(3,ii)<<
" "<<Jac(4,ii)<<
" "<<Jac(5,ii)<<
" "
2246 <<Jac(6,ii)<<std::endl;
2247 std::cout<<
" Nu d(r,p)/d("<<ii<<
") "<<(
r(1)-r0(1))/delta<<
" "
2248 <<(
r(2)-r0(2))/delta<<
" "<<(
r(3)-r0(3))/delta<<
" "
2249 <<(
p(1)-p0(1))/delta<<
" "<<(
p(2)-p0(2))/delta<<
" "
2250 <<(
p(3)-p0(3))/delta<<std::endl;
2252 std::cout<<
" -- An d(r,p)/a("<<ii<<
") "<<Jac(1,ii+3)<<
" "<<Jac(2,ii+3)<<
" "
2253 <<Jac(3,ii+3)<<
" "<<Jac(4,ii+3)<<
" "<<Jac(5,ii+3)<<
" "
2254 <<Jac(6,ii+3)<<std::endl;
2255 std::cout<<
" Nu d(r,p)/a("<<ii<<
") "<<(
r(1)-r0(1))/delta<<
" "
2256 <<(
r(2)-r0(2))/delta<<
" "<<(
r(3)-r0(3))/delta<<
" "
2257 <<(
p(1)-p0(1))/delta<<
" "<<(
p(2)-p0(2))/delta<<
" "
2258 <<(
p(3)-p0(3))/delta<<std::endl;
2271 CLHEP::HepSymMatrix& covLoc,
2272 CLHEP::HepMatrix& rotLoc,
2273 CLHEP::HepVector& R0,
2285 std::cout<<
" gradientLocal "<<std::endl;
2304 CLHEP::HepVector Rt(3),
Pt(3), Rm(3), Pm(3), Norm(3);
2305 Rt(1) = GRt.
x(); Rt(2) = GRt.
y(); Rt(3) = GRt.
z();
2306 Pt(1) = GPt.
x();
Pt(2) = GPt.
y();
Pt(3) = GPt.
z();
2307 Rm(1) = GRm.
x(); Rm(2) = GRm.
y(); Rm(3) = GRm.
z();
2308 Pm(1) = GPm.
x(); Pm(2) = GPm.
y(); Pm(3) = GPm.
z();
2309 Norm(1) = GNorm.
x(); Norm(2) = GNorm.
y(); Norm(3) = GNorm.
z();
2311 CLHEP::HepVector V(4), Rml(3), Pml(3), Rtl(3), Ptl(3);
2319 Rml = rotLoc * (Rm - R0);
2320 Rtl = rotLoc * (Rt - R0);
2324 V(1) = LPRm(0) - Ptl(1)/Ptl(3);
2325 V(2) = LPRm(1) - Ptl(2)/Ptl(3);
2326 V(3) = LPRm(2) - Rtl(1);
2327 V(4) = LPRm(3) - Rtl(2);
2342 CLHEP::HepSymMatrix W = covLoc;
2346 if(ierr != 0) {
if(alarm)
2347 std::cout<<
" gradientLocal: inversion of matrix W fail "<<std::endl;
2359 CLHEP::HepMatrix JacToLoc(4,6,0);
2360 for(
int i=1;
i<=2;
i++)
2361 for(
int j=1;
j<=3;
j++){
2362 JacToLoc(
i,
j+3) = (rotLoc(
i,
j) - rotLoc(3,
j)*Pml(
i)/Pml(3))/Pml(3);
2363 JacToLoc(
i+2,
j) = rotLoc(
i,
j);
2368 double PmN = CLHEP_dot(Pm, Norm);
2370 CLHEP::HepMatrix Jac(6,6,0);
2371 for (
int i=1;
i <= 3;
i++)
2372 for (
int j=1;
j <= 3;
j++){
2373 Jac(
i,
j) = Pm(
i)*Norm(
j) / PmN;
2374 if(
i ==
j ) Jac(
i,
j) -= 1.;
2388 CLHEP::HepVector dsda(3);
2389 dsda(1) = (Norm(2)*Rm(3) - Norm(3)*Rm(2)) / PmN;
2390 dsda(2) = (Norm(3)*Rm(1) - Norm(1)*Rm(3)) / PmN;
2391 dsda(3) = (Norm(1)*Rm(2) - Norm(2)*Rm(1)) / PmN;
2394 Jac(1,4) = Pm(1)*dsda(1);
2395 Jac(2,4) = -Rm(3) + Pm(2)*dsda(1);
2396 Jac(3,4) = Rm(2) + Pm(3)*dsda(1);
2398 Jac(1,5) = Rm(3) + Pm(1)*dsda(2);
2399 Jac(2,5) = Pm(2)*dsda(2);
2400 Jac(3,5) = -Rm(1) + Pm(3)*dsda(2);
2402 Jac(1,6) = -Rm(2) + Pm(1)*dsda(3);
2403 Jac(2,6) = Rm(1) + Pm(2)*dsda(3);
2404 Jac(3,6) = Pm(3)*dsda(3);
2407 CLHEP::HepMatrix JacCorLoc(4,6,0);
2408 JacCorLoc = JacToLoc * Jac;
2411 CLHEP::HepMatrix W_Jac(6,4,0);
2412 W_Jac = JacCorLoc.T() * W;
2414 CLHEP::HepVector gradL(6);
2417 CLHEP::HepMatrix hessL(6,6);
2418 hessL = JacCorLoc.T() * W * JacCorLoc;
2423 CLHEP::HepVector dLI = CLHEP::solve(HessL, -GradL);
2425 CLHEP::HepMatrix ErrdLI = HessL.inverse(iErI);
2426 if( iErI != 0) {
if(alarm)
2427 std::cout<<
" gradLocal Error inverse Hess matrix !!!!!!!!!!!"<<std::endl;
2431 std::cout<<
" dL "<<dLI(1)<<
" "<<dLI(2)<<
" "<<dLI(3)<<
" "<<dLI(4)<<
" "
2432 <<dLI(5)<<
" "<<dLI(6)<<std::endl;;
2434 <<
" "<<
sqrt(ErrdLI(4,4))<<
" "<<
sqrt(ErrdLI(5,5))<<
" "<<
sqrt(ErrdLI(6,6))
2448 if(GNorm.
z() > 0.95)
2449 std::cout<<
" Ecap1 N "<<GNorm<<std::endl;
2450 else if(GNorm.
z() < -0.95)
2451 std::cout<<
" Ecap2 N "<<GNorm<<std::endl;
2453 std::cout<<
" Barrel N "<<GNorm<<std::endl;
2454 std::cout<<
" JacCLo(i,"<<i<<
") = {"<<JacCorLoc(1,i)<<
" "<<JacCorLoc(2,i)<<
" "
2455 <<JacCorLoc(3,i)<<
" "<<JacCorLoc(4,i)<<
"}"<<std::endl;
2456 std::cout<<
" rotLoc "<<rotLoc<<std::endl;
2458 std::cout<<
" Pm,l "<<Pm.T()<<
" "<<Pml(1)/Pml(3)<<
" "<<Pml(2)/Pml(3)<<std::endl;
2459 std::cout<<
" Pt,l "<<Pt.T()<<
" "<<Ptl(1)/Ptl(3)<<
" "<<Ptl(2)/Ptl(3)<<std::endl;
2461 std::cout<<
" Cov \n"<<covLoc<<std::endl;
2462 std::cout<<
" W*Cov "<<W*covLoc<<std::endl;
2466 std::cout<<
" JacToLoc "<<JacToLoc<<std::endl;
2470 #ifdef CHECK_OF_JACOBIAN_CARTESIAN_TO_LOCAL
2472 CLHEP::HepVector V0(4,0);
2473 V0(1) = Pml(1)/Pml(3) - Ptl(1)/Ptl(3);
2474 V0(2) = Pml(2)/Pml(3) - Ptl(2)/Ptl(3);
2475 V0(3) = Rml(1) - Rtl(1);
2476 V0(4) = Rml(2) - Rtl(2);
2477 int ii = 3;
float delta = 0.01;
2478 CLHEP::HepVector V1(4,0);
2479 if(ii <= 3) {Rm(ii) +=
delta; Rml = rotLoc * (Rm - R0);}
2480 else {Pm(ii-3) +=
delta; Pml = rotLoc * Pm;}
2483 V1(1) = Pml(1)/Pml(3) - Ptl(1)/Ptl(3);
2484 V1(2) = Pml(2)/Pml(3) - Ptl(2)/Ptl(3);
2485 V1(3) = Rml(1) - Rtl(1);
2486 V1(4) = Rml(2) - Rtl(2);
2488 if(GNorm.
z() > 0.95)
2489 std::cout<<
" Ecap1 N "<<GNorm<<std::endl;
2490 else if(GNorm.
z() < -0.95)
2491 std::cout<<
" Ecap2 N "<<GNorm<<std::endl;
2493 std::cout<<
" Barrel N "<<GNorm<<std::endl;
2494 std::cout<<
" dldc Num (i,"<<ii<<
") "<<(V1(1)-V0(1))/delta<<
" "<<(V1(2)-V0(2))/delta<<
" "
2495 <<(V1(3)-V0(3))/delta<<
" "<<(V1(4)-V0(4))/delta<<std::endl;
2496 std::cout<<
" dldc Ana (i,"<<ii<<
") "<<JacToLoc(1,ii)<<
" "<<JacToLoc(2,ii)<<
" "
2497 <<JacToLoc(3,ii)<<
" "<<JacToLoc(4,ii)<<std::endl;
2512 CLHEP::HepVector d(3,0),
a(3,0), Norm(3), Rm0(3), Pm0(3), Rm1(3), Pm1(3),
2515 d(1)=0.0; d(2)=0.0; d(3)=0.0;
a(1)=0.0000;
a(2)=0.0000;
a(3)=0.0000;
2527 MuGlShift = d; MuGlAngle =
a;
2529 if((d(1) == 0.) & (d(2) == 0.) & (d(3) == 0.) &
2530 (
a(1) == 0.) & (
a(2) == 0.) & (
a(3) == 0.)){
2534 std::cout<<
" ...... without misalignment "<<std::endl;
2538 Rm0(1) = GRm.
x(); Rm0(2) = GRm.
y(); Rm0(3) = GRm.
z();
2539 Pm0(1) = GPm.
x(); Pm0(2) = GPm.
y(); Pm0(3) = GPm.
z();
2540 Norm(1) = Nl.
x(); Norm(2) = Nl.
y(); Norm(3) = Nl.
z();
2542 CLHEP::HepMatrix
T(3,3,1);
2552 T(1,2) =
c1 * s3 + s1 * s2 * c3;
2553 T(1,3) = s1 * s3 -
c1 * s2 * c3;
2555 T(2,2) =
c1 * c3 - s1 * s2 * s3;
2556 T(2,3) = s1 * c3 +
c1 * s2 * s3;
2563 CLHEP::HepMatrix Ti = T.T();
2564 CLHEP::HepVector di = -Ti * d;
2566 CLHEP::HepVector ex0(3,0), ey0(3,0), ez0(3,0), ex(3,0), ey(3,0), ez(3,0);
2567 ex0(1) = 1.; ey0(2) = 1.; ez0(3) = 1.;
2568 ex = Ti*ex0; ey = Ti*ey0; ez = Ti*ez0;
2570 CLHEP::HepVector TiN = Ti * Norm;
2575 double si = CLHEP_dot((Ti*Rm0 - Rm0 + di), TiN) / CLHEP_dot(Pm0, TiN);
2576 Rm1(1) = CLHEP_dot(ex, Rm0 + si*Pm0 - di);
2577 Rm1(2) = CLHEP_dot(ey, Rm0 + si*Pm0 - di);
2578 Rm1(3) = CLHEP_dot(ez, Rm0 + si*Pm0 - di);
2583 Pm =
GlobalVector(CLHEP_dot(Pm0,ex), CLHEP_dot(Pm0, ey), CLHEP_dot(Pm0,ez));
2588 std::cout<<
" T*Pm0 "<<Pm1.T()<<std::endl;
2592 CLHEP::HepVector Rml = Rm1(1)*ex + Rm1(2)*ey + Rm1(3)*ez + di;
2594 CLHEP::HepVector Rt0(3);
2595 Rt0(1)=Rt.
x(); Rt0(2)=Rt.
y(); Rt0(3)=Rt.
z();
2598 double sl = CLHEP_dot(T*(Rt0 - Rml), T*Norm) / CLHEP_dot(Ti * Pm1, Norm);
2599 CLHEP::HepVector Rl = Rml + sl*(Ti*Pm1);
2604 double A = CLHEP_dot(Ti*Pm1, Norm);
2605 double B = CLHEP_dot(Rt0, Norm) - CLHEP_dot(Ti*Rm1, Norm)
2606 + CLHEP_dot(Ti*d, Norm);
2608 CLHEP::HepVector Dr = Ti*Rm1 - Ti*d + s*(Ti*Pm1) - Rm0;
2609 CLHEP::HepVector Dp = Ti*Pm1 - Pm0;
2611 CLHEP::HepVector TiR = Ti * Rm0 + di;
2612 CLHEP::HepVector Ri = T * TiR + d;
2614 std::cout<<
" --TTi-0 "<<(Ri-Rm0).
T()<<std::endl;
2624 std::cout<<
" -- si sl s "<<si<<
" "<<sl<<
" "<<s<<std::endl;
2627 std::cout<<
" -- Rml-(Rm0+si*Pm0) "<<(Rml - Rm0 - si*Pm0).
T()<<std::endl;
2635 std::cout<<
" --Rl-0 "<<(Rl-Rm0).
T()<<std::endl;
2651 CLHEP::HepVector d(3,0),
a(3,0), Norm(3), Rm0(3), Pm0(3), Rm1(3), Pm1(3),
2654 d(1)=0.0; d(2)=0.0; d(3)=0.0;
a(1)=0.0000;
a(2)=0.0000;
a(3)=0.0000;
2668 MuGlShift = d; MuGlAngle =
a;
2670 if((d(1) == 0.) & (d(2) == 0.) & (d(3) == 0.) &
2671 (
a(1) == 0.) & (
a(2) == 0.) & (
a(3) == 0.)){
2680 std::cout<<
" ...... without misalignment "<<std::endl;
2684 Rm0(1) = GRm.
x(); Rm0(2) = GRm.
y(); Rm0(3) = GRm.
z();
2685 Pm0(1) = GPm.
x(); Pm0(2) = GPm.
y(); Pm0(3) = GPm.
z();
2686 Norm(1) = Nl.
x(); Norm(2) = Nl.
y(); Norm(3) = Nl.
z();
2688 CLHEP::HepMatrix
T(3,3,1);
2698 T(1,2) =
c1 * s3 + s1 * s2 * c3;
2699 T(1,3) = s1 * s3 -
c1 * s2 * c3;
2701 T(2,2) =
c1 * c3 - s1 * s2 * s3;
2702 T(2,3) = s1 * c3 +
c1 * s2 * s3;
2710 CLHEP::HepMatrix Ti = T.T();
2711 CLHEP::HepVector di = -Ti * d;
2713 CLHEP::HepVector ex0(3,0), ey0(3,0), ez0(3,0), ex(3,0), ey(3,0), ez(3,0);
2714 ex0(1) = 1.; ey0(2) = 1.; ez0(3) = 1.;
2715 ex = Ti*ex0; ey = Ti*ey0; ez = Ti*ez0;
2717 CLHEP::HepVector TiN = Ti * Norm;
2722 double si = CLHEP_dot((Ti*Rm0 - Rm0 + di), TiN) / CLHEP_dot(Pm0, TiN);
2723 Rm1(1) = CLHEP_dot(ex, Rm0 + si*Pm0 - di);
2724 Rm1(2) = CLHEP_dot(ey, Rm0 + si*Pm0 - di);
2725 Rm1(3) = CLHEP_dot(ez, Rm0 + si*Pm0 - di);
2731 Pm =
GlobalVector(CLHEP_dot(Pm0,ex), CLHEP_dot(Pm0, ey), CLHEP_dot(Pm0,ez));
2735 CLHEP::HepMatrix Tl(3,3,0);
2749 CLHEP::HepVector R0(3,0), newR0(3,0), newRl(3,0), newPl(3,0);
2754 newRl = Tl * (Rm1 - R0);
2757 Vm(0) = newPl(1)/newPl(3);
2758 Vm(1) = newPl(2)/newPl(3);
2762 #ifdef CHECK_DERIVATIVES_LOCAL_VS_ANGLES
2765 int ii = 2;
T(3,1) -=del;
T(1,3) +=del;
2768 CLHEP::HepVector Rm10 = Rm1, Pm10 = Pm1;;
2769 CLHEP::HepMatrix newTl = Tl*
T;
2772 ex = Ti*ex0; ey = Ti*ey0; ez = Ti*ez0;
2774 si = CLHEP_dot((Ti*Rm0 - Rm0 + di), TiN) / CLHEP_dot(Pm0, TiN);
2775 Rm1(1) = CLHEP_dot(ex, Rm0 + si*Pm0 - di);
2776 Rm1(2) = CLHEP_dot(ey, Rm0 + si*Pm0 - di);
2777 Rm1(3) = CLHEP_dot(ez, Rm0 + si*Pm0 - di);
2780 newRl = Tl * (Rm1 - R0);
2783 Vm(0) = newPl(1)/newPl(3);
2784 Vm(1) = newPl(2)/newPl(3);
2787 std::cout<<
" ========= dVm/da"<<ii<<
" "<<(Vm-Vm0)*(1./del)<<std::endl;
2793 std::cout<<
" ex "<<(Tl.T()*ex0).
T()<<std::endl;
2794 std::cout<<
" ey "<<(Tl.T()*ey0).
T()<<std::endl;
2795 std::cout<<
" ez "<<(Tl.T()*ez0).
T()<<std::endl;
2798 std::cout<<
" pxyz/p gl 0 "<<(Pm0/Pm0.norm()).
T()<<std::endl;
2799 std::cout<<
" pxyz/p loc0 "<<(Tl*Pm0/(Tl*Pm0).norm()).
T()<<std::endl;
2800 std::cout<<
" pxyz/p glob "<<(Pm1/Pm1.norm()).
T()<<std::endl;
2801 std::cout<<
" pxyz/p loc "<<(newPl/newPl.norm()).
T()<<std::endl;
2806 <<atan2(Pm0(2),Pm0(1))<<
" "<<atan2(Pm1(2),Pm1(1))<<
" "
2807 <<atan2((Tl*Pm0)(2),(Tl*Pm0)(1))<<
" "
2808 <<atan2(newPl(2),newPl(1))<<std::endl;
2809 std::cout<<
" ---- angl Gl Loc "<<atan2(Pm1(2),Pm1(1))-atan2(Pm0(2),Pm0(1))<<
" "
2810 <<atan2(newPl(2),newPl(1))-atan2((Tl*Pm0)(2),(Tl*Pm0)(1))<<
" "
2811 <<atan2(newPl(3),newPl(2))-atan2((Tl*Pm0)(3),(Tl*Pm0)(2))<<
" "
2812 <<atan2(newPl(1),newPl(3))-atan2((Tl*Pm0)(1),(Tl*Pm0)(3))<<
" "<<std::endl;
2816 CLHEP::HepMatrix newTl(3,3,0);
2817 CLHEP::HepVector R0(3,0), newRl(3,0), newPl(3,0);
2818 newTl = Tl * Ti.T();
2819 newR0 = Ti * R0 + di;
2830 CLHEP::HepVector Rvc(3,0), Pvc(3,0), Rvg(3,0), Pvg(3,0);
2831 Rvc(1) = Vm(2); Rvc(2) = Vm(3);
2833 sqrt(1 + Vm(0)*Vm(0) + Vm(1)*Vm(1));
2834 Pvc(1) = Pvc(3) * Vm(0);
2835 Pvc(2) = Pvc(3) * Vm(1);
2837 Rvg = newTl.T() * Rvc + newR0;
2838 Pvg = newTl.T() * Pvc;
2840 std::cout<<
" newPl "<<newPl.T()<<std::endl;
2851 std::cout<<
" T*Pm0 "<<Pm1.T()<<std::endl;
2855 CLHEP::HepVector Rml = Rm1(1)*ex + Rm1(2)*ey + Rm1(3)*ez + di;
2857 CLHEP::HepVector Rt0(3);
2858 Rt0(1)=Rt.
x(); Rt0(2)=Rt.
y(); Rt0(3)=Rt.
z();
2861 double sl = CLHEP_dot(T*(Rt0 - Rml), T*Norm) / CLHEP_dot(Ti * Pm1, Norm);
2862 CLHEP::HepVector Rl = Rml + sl*(Ti*Pm1);
2867 double A = CLHEP_dot(Ti*Pm1, Norm);
2868 double B = CLHEP_dot(Rt0, Norm) - CLHEP_dot(Ti*Rm1, Norm)
2869 + CLHEP_dot(Ti*d, Norm);
2871 CLHEP::HepVector Dr = Ti*Rm1 - Ti*d + s*(Ti*Pm1) - Rm0;
2872 CLHEP::HepVector Dp = Ti*Pm1 - Pm0;
2874 CLHEP::HepVector TiR = Ti * Rm0 + di;
2875 CLHEP::HepVector Ri = T * TiR + d;
2877 std::cout<<
" --TTi-0 "<<(Ri-Rm0).
T()<<std::endl;
2887 std::cout<<
" -- si sl s "<<si<<
" "<<sl<<
" "<<s<<std::endl;
2890 std::cout<<
" -- Rml-(Rm0+si*Pm0) "<<(Rml - Rm0 - si*Pm0).
T()<<std::endl;
2898 std::cout<<
" --Rl-0 "<<(Rl-Rm0).
T()<<std::endl;
2914 bool smooth =
false;
2917 std::cout<<
" ......... start of trackFitter ......... "<<std::endl;
2919 this->debugTrackHit(
" Tracker track hits ", alongTr);
2920 this->debugTrackHit(
" Tracker TransientTrack hits ", alongTTr);
2924 DetId trackDetId =
DetId(alongTr->innerDetId());
2932 for(
unsigned int ihit = recHitAlong.
size()-1; ihit+1>0; ihit--){
2935 recHitAlong.
clear();
2938 std::cout<<
" ... Own recHit.size() "<<recHit.
size()<<
" "<<trackDetId.
rawId()<<std::endl;
2943 if((*i)->isValid()){
2951 <<
" ======> recHitMu "<<std::endl;
2959 std::cout<<
" ...along.... recHitMu.size() "<<recHitMu.size()<<std::endl;
2963 for(
unsigned int ihit = recHitMuAlong.size()-1; ihit+1>0; ihit--){
2964 recHitMu.push_back(recHitMuAlong[ihit]);
2966 recHitMuAlong.clear();
2969 std::cout<<
" ...opposite... recHitMu.size() "<<recHitMu.size()<<std::endl;
2982 firstTSOS.
surface(), &*magneticField_);
2989 std::vector<Trajectory> trajVec;
2990 if(direction ==
alongMomentum) trajVec = theFitter->fit(seedT, recHitMu, initialTSOS);
2991 else trajVec = theFitterOp->fit(seedT, recHitMu, initialTSOS);
2994 this->debugTrajectorySOSv(
" innermostTSOS of TransientTrack",
2996 this->debugTrajectorySOSv(
" outermostTSOS of TransientTrack",
2998 this->debugTrajectorySOS(
" initialTSOS for theFitter ", initialTSOS);
2999 std::cout<<
" . . . . . trajVec.size() "<<trajVec.size()<<std::endl;
3000 if(trajVec.size()) this->debugTrajectory(
" theFitter trajectory ", trajVec[0]);
3004 if(trajVec.size()) trackFittedTSOS = trajVec[0].lastMeasurement().updatedState();}
3006 std::vector<Trajectory> trajSVec;
3007 if (trajVec.size()){
3008 if(direction ==
alongMomentum) trajSVec = theSmoother->trajectories(*(trajVec.begin()));
3009 else trajSVec = theSmootherOp->trajectories(*(trajVec.begin()));
3011 if(info)
std::cout<<
" . . . . trajSVec.size() "<<trajSVec.size()<<std::endl;
3012 if(trajSVec.size()) this->debugTrajectorySOSv(
"smoothed geom InnermostState",
3013 trajSVec[0].geometricalInnermostState());
3014 if(trajSVec.size()) trackFittedTSOS = trajSVec[0].geometricalInnermostState();
3017 if(info) this->debugTrajectorySOSv(
" trackFittedTSOS ", trackFittedTSOS);
3028 bool smooth =
false;
3030 if(info)
std::cout<<
" ......... start of muonFitter ........"<<std::endl;
3032 this->debugTrackHit(
" Muon track hits ", alongTr);
3033 this->debugTrackHit(
" Muon TransientTrack hits ", alongTTr);
3037 DetId trackDetId =
DetId(alongTr->innerDetId());
3045 for(
unsigned int ihit = recHitAlong.
size()-1; ihit+1>0; ihit--){
3048 recHitAlong.
clear();
3051 std::cout<<
" ... Own recHit.size() DetId==Muon "<<recHit.
size()<<
" "<<trackDetId.
rawId()<<std::endl;
3056 std::cout<<
" ...along.... recHitMu.size() "<<recHitMu.size()<<std::endl;
3060 for(
unsigned int ihit = recHitMuAlong.size()-1; ihit+1>0; ihit--){
3061 recHitMu.push_back(recHitMuAlong[ihit]);
3063 recHitMuAlong.clear();
3066 std::cout<<
" ...opposite... recHitMu.size() "<<recHitMu.size()<<std::endl;
3079 firstTSOS.
surface(), &*magneticField_);
3086 std::vector<Trajectory> trajVec;
3087 if(direction ==
alongMomentum) trajVec = theFitter->fit(seedT, recHitMu, initialTSOS);
3088 else trajVec = theFitterOp->fit(seedT, recHitMu, initialTSOS);
3091 this->debugTrajectorySOSv(
" innermostTSOS of TransientTrack",
3093 this->debugTrajectorySOSv(
" outermostTSOS of TransientTrack",
3095 this->debugTrajectorySOS(
" initialTSOS for theFitter ", initialTSOS);
3096 std::cout<<
" . . . . . trajVec.size() "<<trajVec.size()<<std::endl;
3097 if(trajVec.size()) this->debugTrajectory(
" theFitter trajectory ", trajVec[0]);
3101 if(trajVec.size()) trackFittedTSOS = trajVec[0].lastMeasurement().updatedState();}
3103 std::vector<Trajectory> trajSVec;
3104 if (trajVec.size()){
3105 if(direction ==
alongMomentum) trajSVec = theSmoother->trajectories(*(trajVec.begin()));
3106 else trajSVec = theSmootherOp->trajectories(*(trajVec.begin()));
3108 if(info)
std::cout<<
" . . . . trajSVec.size() "<<trajSVec.size()<<std::endl;
3109 if(trajSVec.size()) this->debugTrajectorySOSv(
"smoothed geom InnermostState",
3110 trajSVec[0].geometricalInnermostState());
3111 if(trajSVec.size()) trackFittedTSOS = trajSVec[0].geometricalInnermostState();
3120 std::cout<<
" ------- "<<title<<
" --------"<<std::endl;
3124 std::cout<<
" Hit "<<nHit++<<
" DetId "<<(*i)->geographicalId().det();
3128 if(!(*i)->isValid())
std::cout<<
" not valid "<<std::endl;
3137 std::cout<<
" ------- "<<title<<
" --------"<<std::endl;
3141 std::cout<<
" Hit "<<nHit++<<
" DetId "<<(*i)->geographicalId().det();
3145 if(!(*i)->isValid())
std::cout<<
" not valid "<<std::endl;
3154 std::cout<<
" --- "<<title<<
" --- "<<std::endl;
3186 std::cout<<
" --- "<<title<<
" --- "<<std::endl;
3217 std::cout<<
"\n"<<
" ...... "<<title<<
" ...... "<<std::endl;
3218 if(!traj.
isValid()) {
std::cout<<
" Not valid !!!!!!!! "<<std::endl;
return;}
3221 else std::cout<<
" oppositeToMomentum <<<<"<<std::endl;
3226 std::cout<<
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . \n"<<std::endl;
3244 std::cout<<
" paramVector "<<paramVec.T()<<std::endl;
3246 CLHEP::Hep3Vector colX, colY, colZ;
3248 #ifdef NOT_EXACT_ROTATION_MATRIX
3249 colX = CLHEP::Hep3Vector( 1., -paramVec(6), paramVec(5));
3250 colY = CLHEP::Hep3Vector( paramVec(6), 1., -paramVec(4));
3251 colZ = CLHEP::Hep3Vector(-paramVec(5), paramVec(4), 1.);
3256 colX = CLHEP::Hep3Vector( c2 * c3, -c2 * s3, s2);
3257 colY = CLHEP::Hep3Vector(
c1 * s3 + s1 * s2 * c3,
c1 * c3 - s1 * s2 * s3, -s1 * c2);
3258 colZ = CLHEP::Hep3Vector(s1 * s3 -
c1 * s2 * c3, s1 * c3 +
c1 * s2 * s3,
c1 * c2);
3261 CLHEP::HepVector param0(6,0);
3267 iteratorTrackerRcd->rotation(),
3270 CLHEP::Hep3Vector posMuGlRcd = iteratorMuonRcd->translation();
3271 CLHEP::HepRotation rotMuGlRcd = iteratorMuonRcd->rotation();
3272 CLHEP::HepEulerAngles angMuGlRcd = iteratorMuonRcd->rotation().eulerAngles();
3274 std::cout<<
" Old muon Rcd Euler angles "<<angMuGlRcd.phi()<<
" "<<angMuGlRcd.theta()
3275 <<
" "<<angMuGlRcd.psi()<<std::endl;
3277 if((angMuGlRcd.phi() == 0.) && (angMuGlRcd.theta() == 0.) && (angMuGlRcd.psi() == 0.) &&
3278 (posMuGlRcd.x() == 0.) && (posMuGlRcd.y() == 0.) && (posMuGlRcd.z() == 0.)){
3279 std::cout<<
" New muon parameters are stored in Rcd"<<std::endl;
3290 else if((paramVec(1) == 0.) && (paramVec(2) == 0.) && (paramVec(3) == 0.) &&
3291 (paramVec(4) == 0.) && (paramVec(5) == 0.) && (paramVec(6) == 0.)){
3292 std::cout<<
" Old muon parameters are stored in Rcd"<<std::endl;
3295 iteratorMuonRcd->rotation(),
3300 std::cout<<
" New + Old muon parameters are stored in Rcd"<<std::endl;
3301 CLHEP::Hep3Vector posMuGlRcdThis = CLHEP::Hep3Vector(paramVec(1), paramVec(2), paramVec(3));
3302 CLHEP::HepRotation rotMuGlRcdThis = CLHEP::HepRotation(colX, colY, colZ);
3303 CLHEP::Hep3Vector posMuGlRcdNew = rotMuGlRcdThis * posMuGlRcd + posMuGlRcdThis;
3304 CLHEP::HepRotation rotMuGlRcdNew = rotMuGlRcdThis * rotMuGlRcd;
3314 iteratorEcalRcd->rotation(),
3318 iteratorHcalRcd->rotation(),
3330 <<
" " <<
tracker.rotation().eulerAngles() << std::endl;
3334 <<
" " << muon.
rotation().eulerAngles() << std::endl;
3335 std::cout <<
" rotations angles around x,y,z "
3337 <<
" " << -muon.
rotation().yx() <<
" )" << std::endl;
3341 <<
" " <<
ecal.rotation().eulerAngles() << std::endl;
3345 <<
" " <<
hcal.rotation().eulerAngles() << std::endl;
3348 std::cout <<
"Calo (" << calo.rawId() <<
") at " << calo.translation()
3349 <<
" " << calo.rotation().eulerAngles() << std::endl;
3350 std::cout << calo.rotation() << std::endl;
3353 globalPositions->
m_align.push_back(muon);
3356 globalPositions->
m_align.push_back(calo);
3358 std::cout <<
"Uploading to the database..." << std::endl;
3363 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
3373 "GlobalPositionRcd");
const GlobalTrackingGeometry * trackingGeometry_
edm::ESWatcher< GlobalPositionRcd > watchGlobalPositionRcd_
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
void debugTrajectorySOSv(const std::string, TrajectoryStateOnSurface)
KFTrajectorySmoother * theSmootherOp
double pzSign() const
Sign of the z-component of the momentum in the local frame.
void gradientGlobalAlg(GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, AlgebraicSymMatrix66 &)
void gradientLocal(GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, CLHEP::HepSymMatrix &, CLHEP::HepMatrix &, CLHEP::HepVector &, AlgebraicVector4 &)
TrackCharge charge() const
const LocalTrajectoryParameters & localParameters() const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
GlobalVector normalVector() const
Sin< T >::type sin(const T &t)
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
KFTrajectoryFitter * theFitter
const CartesianTrajectoryError cartesianError() const
CLHEP::HepVector MuGlAngle
void misalignMuon(GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &)
int bunchCrossing() const
std::vector< AlignTransform >::const_iterator iteratorHcalRcd
GlobalPoint globalPosition() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
DEFINE_FWK_MODULE(HiMixingModule)
void gradientGlobal(GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, AlgebraicSymMatrix66 &)
std::vector< AlignTransform > m_align
ROOT::Math::SVector< double, 6 > AlgebraicVector6
std::vector< ConstRecHitPointer > RecHitContainer
TrajectoryStateOnSurface innermostMeasurementState() const
PropagationDirection const & direction() const
uint32_t rawId() const
get the raw id
AlgebraicVector5 vector() const
void debugTrackHit(const std::string, reco::TrackRef)
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
tuple SteppingHelixPropagator
FreeTrajectoryState * freeState(bool withErrors=true) const
edm::ESWatcher< GlobalTrackingGeometryRecord > watchTrackingGeometry_
TrajectoryMeasurement const & lastMeasurement() const
Cos< T >::type cos(const T &t)
KFTrajectoryFitter * theFitterOp
ROOT::Math::SVector< double, 3 > AlgebraicVector3
std::vector< AlignTransform >::const_iterator iteratorMuonRcd
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void analyzeTrackTrajectory(const edm::Event &, const edm::EventSetup &)
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
TrajectoryStateOnSurface updatedState() const
const AlgebraicSymMatrix55 & matrix() const
double CLHEP_dot(CLHEP::HepVector a, CLHEP::HepVector b)
const MagneticField * magneticField_
const LocalTrajectoryError & localError() const
TrajectoryStateOnSurface outermostMeasurementState() const
tuple Chi2MeasurementEstimator
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
trackingRecHit_iterator recHitsEnd() const
last iterator to RecHits
const AlgebraicSymMatrix66 & matrix() const
void misalignMuonL(GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, GlobalVector &, AlgebraicVector4 &, TrajectoryStateOnSurface &, TrajectoryStateOnSurface &)
GlobalTrackerMuonAlignment(const edm::ParameterSet &)
void writeGlPosRcd(CLHEP::HepVector &d3)
tuple GlobalTrackerMuonAlignment
std::vector< AlignTransform >::const_iterator iteratorEcalRcd
TrajectoryMeasurement const & firstMeasurement() const
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
void trackFitter(reco::TrackRef, reco::TransientTrack &, PropagationDirection, TrajectoryStateOnSurface &)
~GlobalTrackerMuonAlignment()
KFTrajectorySmoother * theSmoother
ROOT::Math::SVector< double, 5 > AlgebraicVector5
const GlobalTrajectoryParameters & globalParameters() const
const Alignments * globalPositionRcd_
const TransientTrackingRecHitBuilder * TTRHBuilder
edm::ESWatcher< IdealMagneticFieldRecord > watchMagneticFieldRecord_
GlobalVector globalMomentum() const
void debugTrajectory(const std::string, Trajectory &)
cond::Time_t currentTime() const
const Surface & surface() const
tuple KFTrajectorySmoother
const RotationType & rotation() const
std::vector< AlignTransform >::const_iterator iteratorTrackerRcd
ROOT::Math::SVector< double, 4 > AlgebraicVector4
edm::ESWatcher< TrackingComponentsRecord > watchTrackingComponentsRecord_
const PositionType & position() const
void analyzeTrackTrack(const edm::Event &, const edm::EventSetup &)
trackingRecHit_iterator recHitsBegin() const
first iterator to RecHits
AlgebraicVector6 vector() const
void muonFitter(reco::TrackRef, reco::TransientTrack &, PropagationDirection, TrajectoryStateOnSurface &)
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
double chiSquared() const
MuonTransientTrackingRecHitBuilder * MuRHBuilder
Global3DVector GlobalVector
CLHEP::HepVector MuGlShift
void debugTrajectorySOS(const std::string, TrajectoryStateOnSurface &)