@@ -552,8 +552,9 @@ void AlignableVolume::writeLabeledPedeResults(FILE* parOut) const
552552{
553553 // write parameters with labels
554554 for (int i = 0 ; i < mNDOFs ; i++) {
555- fprintf (parOut, " %9d %+e %+e\t ! %s %d:%s vol:%d %s %s\n " , getParLab (i), -getParVal (i), getParErr (i), GetName (), i, sDOFName [i], getVolID (),
556- isFreeDOF (i) ? " " : " FXU" , isZeroAbs (getParVal (i)) ? " FXP" : " " );
555+ auto a = fprintf (parOut, " %9d %+e %+e\t ! %s %d:%s vol:%d %s %s\n " , getParLab (i), -getParVal (i), getParErr (i), GetName (), i, sDOFName [i], getVolID (),
556+ isFreeDOF (i) ? " " : " FXU" ,
557+ isZeroAbs (getParVal (i)) ? " FXP" : " " );
557558 }
558559 // children volume
559560 int nch = getNChildren ();
@@ -690,13 +691,17 @@ bool AlignableVolume::createLocDeltaMatrix(TGeoHMatrix& deltaM) const
690691 auto pars = getParVals ();
691692 double corr[kNDOFGeom ] = {0 .};
692693 int nonZero = 0 ;
694+ LOGP (info, " Applying parameters to create LocDeltaMatrix" );
693695 for (int i = kNDOFGeom ; i--;) {
694696 if (pars[i] != 0 .) {
695697 nonZero++;
696698 corr[i] = pars[i];
699+ LOGP (info, " - PAR {}: {}" , i, pars[i]);
697700 }
698701 } // we need doubles
699702 delta2Matrix (deltaM, corr);
703+ LOGP (info, " Before deltaM:" );
704+ deltaM.Print ();
700705 if (isFrameTRA () && nonZero) { // we need corrections in local frame!
701706 // l' = T2L * delta_t * t = T2L * delta_t * T2L^-1 * l = delta_l * l
702707 // -> delta_l = T2L * delta_t * T2L^-1
@@ -705,6 +710,8 @@ bool AlignableVolume::createLocDeltaMatrix(TGeoHMatrix& deltaM) const
705710 deltaM.Multiply (&t2li);
706711 deltaM.MultiplyLeft (&t2l);
707712 }
713+ LOGP (info, " After isFrameTRA={}; nonZero={} deltaM:" , isFrameTRA (), nonZero);
714+ deltaM.Print ();
708715 return nonZero;
709716}
710717
@@ -727,6 +734,7 @@ void AlignableVolume::createAlignmenMatrix(TGeoHMatrix& alg, const TGeoHMatrix*
727734
728735 const AlignableVolume* par = getParent ();
729736 bool nonTrivial = createGloDeltaMatrix (alg);
737+ LOGP (info, " ~ Has {} parent; nonTrivial={}; envelopeDelta={}" , par != nullptr , nonTrivial, envelopeDelta != nullptr );
730738 if (envelopeDelta) {
731739 if (nonTrivial) {
732740 alg.MultiplyLeft (envelopeDelta);
@@ -741,13 +749,23 @@ void AlignableVolume::createAlignmenMatrix(TGeoHMatrix& alg, const TGeoHMatrix*
741749 // if envelopeDelta is provided, then there should be
742750 TGeoHMatrix dchain;
743751 while (par) {
752+ LOGP (info, " attaching parent {} to chain" , par->getSymName ());
744753 dchain.MultiplyLeft (&par->getGlobalDeltaRef ());
745754 par = par->getParent ();
746755 }
747756 const TGeoHMatrix& dchaini = dchain.Inverse ();
748757 alg.Multiply (&dchain);
749758 alg.MultiplyLeft (&dchaini);
759+ } else {
760+ if (!nonTrivial) {
761+ LOGP (info, " TRIVIAL!" );
762+ }
763+ if (par && par->isDummyEnvelope ()) {
764+ LOGP (info, " parent is a dummy enevelope" );
765+ }
750766 }
767+ LOGP (info, " GlobalDeltaRef is:" );
768+ getGlobalDeltaRef ().Print ();
751769 alg *= getGlobalDeltaRef ();
752770
753771 /* // bad precision ?
@@ -799,6 +817,7 @@ void AlignableVolume::createAlignmentObjects(std::vector<o2::detectors::AlignPar
799817 }
800818 TGeoHMatrix algM;
801819 bool nonTrivial = false ;
820+ LOGP (info, " ~ {}: {} isDummy={} isDummyEnvelope={}" , getVolID (), getSymName (), isDummy (), isDummyEnvelope ());
802821 if (!isDummyEnvelope ()) {
803822 createAlignmenMatrix (algM, envelopeDelta);
804823 arr.emplace_back (getSymName (), getVolID (), algM, true ).rectify (AlignConfig::Instance ().alignParamZero );
@@ -814,8 +833,13 @@ void AlignableVolume::createAlignmentObjects(std::vector<o2::detectors::AlignPar
814833 nonTrivial = true ;
815834 }
816835 envelopeDelta = &algM;
836+ LOGP (info, " envelope delta:" );
837+ envelopeDelta->Print ();
817838 }
818839
840+ LOGP (info, " global delta:" );
841+ algM.Print ();
842+
819843 int nch = getNChildren ();
820844 for (int ich = 0 ; ich < nch; ich++) {
821845 getChild (ich)->createAlignmentObjects (arr, nonTrivial ? envelopeDelta : nullptr );
0 commit comments