|
ATLAS Offline Software
|
#include <ShiftingDerivCalcTool.h>
|
| ShiftingDerivCalcTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~ShiftingDerivCalcTool () |
|
StatusCode | initialize () |
|
StatusCode | finalize () |
|
bool | setDerivatives (AlignTrack *track) |
| sets derivatives of residuals w.r.t. More...
|
|
void | showStatistics () |
| write statistics to log file More...
|
|
bool | setResidualCovMatrix (AlignTrack *alignTrack) const |
| sets residual covariance matrix More...
|
|
void | setSolveOption (int solveOption) |
| solving option (see enum above) More...
|
|
virtual void | setLogStream (std::ostream *os) |
| sets the output stream for the logfile More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
Amg::VectorX | getDerivatives (AlignTrack *alignTrack, int ipar, AlignPar *alignPar, Amg::VectorX &derivativeErr, bool &resetIPar, double &actualSecondDerivative) |
|
void | setChi2VAlignParam (const AlignTrack *alignTrack, const AlignModule *module, int nshifts=0) |
|
void | deleteChi2VAlignParam () |
|
double | shiftSize (const AlignPar *alignPar) const |
|
bool | setUnshiftedResiduals (AlignTrack *alignTrack) |
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
|
const Trk::Track * | bestPerigeeTrack (const Track *track) const |
|
bool | scanShifts (const AlignTrack *alignTrack, const std::vector< AlignModule * > &alignModules) |
|
bool | getAllDerivatives (AlignTrack *alignTrack, const AlignModule *alignModule, std::vector< Amg::VectorX > &deriv_vec, std::vector< Amg::VectorX > &derivErr_vec, std::vector< double > &actualsecderiv_vec, bool &resetIPar) |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 47 of file ShiftingDerivCalcTool.h.
◆ DerivativeMap
◆ DerivativePair
◆ HitDerivative
◆ StoreGateSvc_t
◆ SolveOption
enum of different solving options
Enumerator |
---|
NONE | not solve in any case (to be used when ipc)
|
SOLVE | solving after data accumulation (LAPACK)
|
SOLVE_FAST | Fast (Eigen method) solving after data accumulation.
|
DIRECT_SOLVE | direct solving (LAPACK), already available matrix & vector
|
DIRECT_SOLVE_FAST | direct Fast (Eigen method) solving, already available matrix & vector
|
DIRECT_SOLVE_CLUSTER | computation of alignment parameters from SCALAPAK already solved matrix
|
Definition at line 41 of file IDerivCalcTool.h.
◆ ShiftingDerivCalcTool()
ShiftingDerivCalcTool::ShiftingDerivCalcTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~ShiftingDerivCalcTool()
ShiftingDerivCalcTool::~ShiftingDerivCalcTool |
( |
| ) |
|
|
virtual |
◆ bestPerigeeTrack()
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ deleteChi2VAlignParam()
void ShiftingDerivCalcTool::deleteChi2VAlignParam |
( |
| ) |
|
|
protected |
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode ShiftingDerivCalcTool::finalize |
( |
| ) |
|
◆ getAllDerivatives()
bool ShiftingDerivCalcTool::getAllDerivatives |
( |
AlignTrack * |
alignTrack, |
|
|
const AlignModule * |
alignModule, |
|
|
std::vector< Amg::VectorX > & |
deriv_vec, |
|
|
std::vector< Amg::VectorX > & |
derivErr_vec, |
|
|
std::vector< double > & |
actualsecderiv_vec, |
|
|
bool & |
resetIPar |
|
) |
| |
|
private |
Definition at line 936 of file ShiftingDerivCalcTool.cxx.
947 derivErr_vec.clear();
948 actualsecderiv_vec.clear();
957 double actualSecondDeriv(0.);
962 if (resetIPar)
continue;
964 if (
vec.rows()<1)
return false;
966 deriv_vec.push_back(
vec);
967 derivErr_vec.push_back(derivErr);
968 actualsecderiv_vec.push_back(actualSecondDeriv);
◆ getDerivatives()
Definition at line 496 of file ShiftingDerivCalcTool.cxx.
511 ATH_MSG_ERROR(
"set m_fitter before calling getDerivatives (by calling setUnshiftedResiduals)");
517 const int NMEAS = alignTrack->nAlignTSOSMeas();
521 double** residuals=
new double*[NFITS];
522 double** resErrors=
new double*[NFITS];
523 double* chi2Array =
new double[NFITS];
524 double* chi2ArrayX=
new double[NFITS];
531 for (
int ifit=0;ifit<NFITS;ifit++) {
532 residuals[ifit]=
new double[NMEAS];
533 resErrors[ifit]=
new double[NMEAS];
539 ATH_MSG_DEBUG(
"chi2Array["<<unshiftedTrackIndex<<
"]="<<chi2Array[unshiftedTrackIndex]);
540 chi2ArrayX[unshiftedTrackIndex] = 0.;
553 IGlobalTrackFitter::AlignmentCache alignCache;
557 for (
int ifit=0;ifit<NFITS;ifit++) {
561 if (ifit>unshiftedTrackIndex) {
562 jfit=NFITS-ifit+unshiftedTrackIndex;
564 if (
m_doFits && ifit==unshiftedTrackIndex) {
566 residuals[ifit][
i]=(*m_unshiftedResiduals)[
i];
567 resErrors[ifit][
i]=(*m_unshiftedResErrors)[
i];
575 double currentshift = 0.;
577 currentshift = shiftsize * (
double)(jfit-unshiftedTrackIndex);
579 currentshift = (ifit==0) ? -1.*shiftsize : shiftsize;
581 ATH_MSG_DEBUG(
"current shift="<<currentshift<<
" in getDerivatives");
584 alignPar->paramType(),currentshift);
588 const Track* refittedTrack=
m_fitter->alignmentFit(alignCache,
598 delete [] residuals;
delete [] resErrors;
599 delete [] chi2Array;
delete [] chi2ArrayX;
616 if (!refittedTrack) {
617 msg(MSG::WARNING) <<
"track refit failed for jfit "<<jfit <<
endmsg;
618 delete [] residuals;
delete [] resErrors;
619 delete [] chi2Array;
delete [] chi2ArrayX;
631 double chi2=refittedTrack->fitQuality()->chiSquared();
637 chi2ArrayX[jfit]= shiftsize * (
double)(jfit-unshiftedTrackIndex);
638 chi2Array[jfit]=localChi2;
652 for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) {
653 if (!(*atsosItr)->isValid())
continue;
654 for (std::vector<Residual>::const_iterator itRes=(**atsosItr).firstResidual();
655 itRes!=(**atsosItr).lastResidual();++itRes,++imeas) {
658 residuals[jfit][imeas]=itRes->residual();
659 resErrors[jfit][imeas]=std::sqrt(itRes->errSq());
662 residuals[jfit][imeas]=resErrors[jfit][imeas]=0.;
664 ATH_MSG_DEBUG(
"residuals["<<jfit<<
"]["<<imeas<<
"]="<<residuals[jfit][imeas]);
665 ATH_MSG_DEBUG(
"resErrors["<<jfit<<
"]["<<imeas<<
"]="<<resErrors[jfit][imeas]);
669 delete refittedTrack; refittedTrack=
nullptr;
676 for (; aatsosItr != alignTrack->lastAtsos(); ++aatsosItr) {
677 if (!(*aatsosItr)->isValid())
continue;
678 for (std::vector<Residual>::const_iterator itRes=(**aatsosItr).firstResidual();
679 itRes!=(**aatsosItr).lastResidual();++itRes,++iimeas) {
680 for (
int ifit=0;ifit<NFITS;ifit++) {
681 ATH_MSG_DEBUG(
"["<<ifit<<
"]["<<iimeas<<
"] res="<<residuals[ifit][iimeas]<<
682 ", resErr="<<resErrors[ifit][iimeas]);
689 delete [] residuals;
delete [] resErrors;
690 delete [] chi2Array;
delete [] chi2ArrayX;
698 TGraph*
gr =
new TGraph(
m_nFits,chi2ArrayX,chi2Array);
699 gr->Fit(
"pol2",
"QF");
700 TF1*
fit=
gr->GetFunction(
"pol2");
702 double slope=
fit->GetParameter(1);
703 actualSecondDeriv=
fit->GetParameter(2);
707 alignTrack->setTrackAlignParamQuality(alignPar->paramType(),
chi2);
710 if (
chi2>1.
e-6 || std::fabs(slope)<1.
e-10) {
727 Amg::VectorX derivatives(alignTrack->nAlignTSOSMeas(),0);
728 ATH_MSG_DEBUG(
"created derivatives with "<<derivatives.rows()<<
" rows");
733 delete [] residuals;
delete [] resErrors;
734 delete [] chi2Array;
delete [] chi2ArrayX;
748 return emptyDerivatives;
752 TCanvas*
canv(
nullptr);
753 std::vector<TGraph*> vecGraphs;
755 for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) {
756 if (!(*atsosItr)->isValid())
continue;
757 for (
int idim=0;idim<(*atsosItr)->nResDim();idim++) {
759 double* gr_x =
new double[NFITS];
760 double* gr_y =
new double[NFITS];
762 for (
int ifit=0;ifit<NFITS;ifit++) {
763 double residual=residuals[ifit][imeas];
764 double resError=resErrors[ifit][imeas];
766 gr_x[ngoodfits] =chi2ArrayX[ifit];
773 derivatives[imeas]=(residuals[1][imeas]-residuals[0][imeas])/(2.*shiftsize)*
774 resErrors[unshiftedTrackIndex][imeas];
777 TGraph*
gr=
new TGraph(ngoodfits,gr_x,gr_y);
780 gr->Fit(
"pol2",
"VF");
782 gr->Fit(
"pol2",
"QF");
783 TF1*
fit=
gr->GetFunction(
"pol2");
787 <<
", chi2="<<
fit->GetChisquare());
788 derivatives[imeas]=
fit->GetParameter(1)*resErrors[unshiftedTrackIndex][imeas];
789 derivativeErr[imeas]=
fit->GetParError(1)*resErrors[unshiftedTrackIndex][imeas];
794 if (!
canv)
canv=
new TCanvas(
"resPlots",
"resPlots");
796 gr->SetMarkerStyle(20);
799 gr->GetXaxis()->SetTitle(
"shift in chamber pos. from nominal (CLHEP::mm)");
800 gr->GetYaxis()->SetTitle(
"residual (CLHEP::mm)");
802 TPaveText* pave=
new TPaveText(.4,.65,.97,.92,
"NDC");
803 pave->SetFillColor(0);
804 pave->SetBorderSize(1);
805 std::stringstream measType; measType<<
"meas type: ";
809 else measType<<
" undefined";
811 pave->AddText(measType.str().c_str());
813 std::stringstream firstderivtxt,secndderivtxt,aptxt,chi2txt;
814 firstderivtxt<<
fit->GetParameter(1)<<
" +/- "<<
fit->GetParError(1);
815 secndderivtxt<<
fit->GetParameter(2)<<
" +/- "<<
fit->GetParError(2);
816 aptxt <<
"alignPar "<<alignPar->paramType()<<
", RIO in "<<(*atsosItr)->identify();
817 chi2txt<<
"chi2="<<
fit->GetChisquare();
819 pave->AddText(firstderivtxt.str().c_str());
820 pave->AddText(secndderivtxt.str().c_str());
821 pave->AddText(aptxt.str().c_str());
822 pave->AddText(chi2txt.str().c_str());
825 std::stringstream canvName;
826 canvName<<
"resPlots_ap"<<alignPar->paramType()<<
"_measType"
827 <<(*atsosItr)->measType()<<
"_"<<imeas<<
".eps";
828 canv->Print(canvName.str().c_str());
833 vecGraphs.push_back(
gr);
836 derivatives[imeas]=-999.;
837 derivativeErr[imeas]=-999.;
848 for (
auto & vecGraph : vecGraphs)
856 for (
int ifit=0;ifit<NFITS;ifit++) {
◆ initialize()
StatusCode ShiftingDerivCalcTool::initialize |
( |
| ) |
|
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
const InterfaceID & IDerivCalcTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
Retrieve interface ID.
Definition at line 84 of file IDerivCalcTool.h.
85 return IID_TRKALIGNINTERFACES_IDerivCalcTool;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ scanShifts()
Definition at line 164 of file ShiftingDerivCalcTool.cxx.
174 m_fitter = alignTrack->isSLTrack() ?
177 <<alignTrack->isSLTrack()<<
")");
183 IGlobalTrackFitter::AlignmentCache alignCache;
185 const Track* refittedTrack =
m_fitter->alignmentFit(alignCache, *trackForRefit,
188 if (!refittedTrack) {
189 msg(MSG::WARNING) <<
"initial track refit failed" <<
endmsg;
204 for (std::vector<AlignModule*>::const_iterator moduleIt=alignModules.begin();
205 moduleIt!=alignModules.end(); ++moduleIt,imod++) {
211 alignParIt!=alignPars->
end(); ++alignParIt,ipar++) {
213 for (
int ishift=0;ishift<2;ishift++) {
215 double shiftsize =
shiftSize(*alignParIt);
216 if (ishift>0) shiftsize*=-1.;
217 m_alignModuleTool->shiftModule(*moduleIt,alignTrack,(**alignParIt).paramType(),shiftsize);
218 refittedTrack = (
m_fitter->fit(Gaudi::Hive::currentContext(),
222 if (!refittedTrack) {
223 msg(MSG::WARNING) <<
"track refit failed!"<<
endmsg;
228 int nIter=alignCache.m_iterationsOfLastFit;
◆ setChi2VAlignParam()
◆ setDerivatives()
bool ShiftingDerivCalcTool::setDerivatives |
( |
AlignTrack * |
track | ) |
|
|
virtual |
sets derivatives of residuals w.r.t.
alignment parameters for hits on track.
Implements Trk::IDerivCalcTool.
Definition at line 328 of file ShiftingDerivCalcTool.cxx.
335 std::vector<AlignModule*> alignModules;
337 atsosItr != alignTrack->lastAtsos(); ++atsosItr) {
346 if (!(*atsosItr)->isValid() || !
module)
continue;
347 if (
find(alignModules.begin(),alignModules.end(),
module) == alignModules.end())
348 alignModules.push_back(
module);
368 std::vector<AlignModuleDerivatives> * derivatives =
new std::vector<AlignModuleDerivatives>;
369 std::vector<AlignModuleDerivatives> * derivativeErr =
new std::vector<AlignModuleDerivatives>;
370 std::vector<std::pair<AlignModule*, std::vector<double> > > * actualSecondDerivatives =
371 new std::vector<std::pair<AlignModule*, std::vector<double> > >;
373 for (
auto *alignModule : alignModules) {
375 ATH_MSG_DEBUG(
"finding derivatives for module "<<(*alignModule).identify());
377 std::vector<Amg::VectorX> deriv_vec;
378 std::vector<Amg::VectorX> derivErr_vec;
379 std::vector<double> actualsecderiv_vec;
383 const int nAlignPar = alignPars->
size();
394 bool resetIPar=
false;
395 std::vector<Amg::VectorX> tmpderiv_vec;
396 std::vector<Amg::VectorX> tmpderivErr_vec;
397 std::vector<double> tmpactualsecderiv_vec;
402 alignTrack, alignModule,
403 tmpderiv_vec,tmpderivErr_vec,tmpactualsecderiv_vec,
407 delete derivativeErr;
408 delete actualSecondDerivatives;
418 tmpderiv_vec,tmpderivErr_vec,tmpactualsecderiv_vec,
424 delete derivativeErr;
425 delete actualSecondDerivatives;
435 tmpderiv_vec,tmpderivErr_vec,tmpactualsecderiv_vec,
441 delete derivativeErr;
442 delete actualSecondDerivatives;
449 if (success && !resetIPar) {
450 for (
int i=0;
i<(
int)tmpderiv_vec.size();
i++) {
451 deriv_vec.push_back(tmpderiv_vec[
i]);
452 derivErr_vec.push_back(tmpderivErr_vec[
i]);
453 actualsecderiv_vec.push_back(tmpactualsecderiv_vec[
i]);
458 delete derivativeErr;
459 delete actualSecondDerivatives;
478 derivatives->push_back(make_pair(alignModule,deriv_vec));
479 derivativeErr->push_back(make_pair(alignModule,derivErr_vec));
480 actualSecondDerivatives->push_back(make_pair(alignModule,actualsecderiv_vec));
485 alignTrack->setDerivatives(derivatives);
486 alignTrack->setDerivativeErr(derivativeErr);
487 alignTrack->setActualSecondDerivatives(actualSecondDerivatives);
◆ setLogStream()
virtual void Trk::IDerivCalcTool::setLogStream |
( |
std::ostream * |
os | ) |
|
|
inlinevirtualinherited |
◆ setResidualCovMatrix()
bool ShiftingDerivCalcTool::setResidualCovMatrix |
( |
AlignTrack * |
alignTrack | ) |
const |
|
virtual |
sets residual covariance matrix
Implements Trk::IDerivCalcTool.
Definition at line 880 of file ShiftingDerivCalcTool.cxx.
882 Amg::MatrixX W(alignTrack->nAlignTSOSMeas(),alignTrack->nAlignTSOSMeas());
884 if (alignTrack->localErrorMatrixInv()) {
885 ATH_MSG_ERROR(
"Need to assign this matrix correctly: ShiftingDerivCalcTool.cxx:888");
886 W = *(alignTrack->localErrorMatrixInv());
894 const double epsilon=1
e-10;
895 for(
int irow=0; irow<
W.rows(); ++irow) {
896 Wisvalid = Wisvalid &&
W(irow,irow)>0;
897 if( !(
W(irow,irow)>0) )
898 msg(MSG::WARNING) <<
"matrix invalid: " <<
W(irow,irow) <<
endmsg;
904 bool Wcorrisvalid = Wcorr+epsilon>=-1 && Wcorr-epsilon<=1;
905 Wisvalid = Wisvalid && Wcorrisvalid;
907 msg(MSG::WARNING) <<
"matrix corr invalid: " << Wcorr-1 <<
" " << Wcorr+1 <<
endmsg;
914 alignTrack->setWeightMatrixFirstDeriv(
new Amg::MatrixX(std::move(
W)));
◆ setSolveOption()
void Trk::IDerivCalcTool::setSolveOption |
( |
int |
solveOption | ) |
|
|
inlineinherited |
◆ setUnshiftedResiduals()
bool ShiftingDerivCalcTool::setUnshiftedResiduals |
( |
AlignTrack * |
alignTrack | ) |
|
|
protected |
Definition at line 246 of file ShiftingDerivCalcTool.cxx.
250 m_fitter = alignTrack->isSLTrack() ?
253 <<alignTrack->isSLTrack()<<
")");
257 IGlobalTrackFitter::AlignmentCache alignCache;
263 if (!trackForRefit) {
268 const Track* refittedTrack =
m_fitter->alignmentFit( alignCache,
273 if (!refittedTrack) {
291 const int NMEAS=alignTrack->nAlignTSOSMeas();
303 for (; atsosItr != alignTrack->lastAtsos(); ++atsosItr) {
304 if (!(**atsosItr).isValid())
continue;
305 for (std::vector<Residual>::const_iterator itRes=(**atsosItr).firstResidual();
306 itRes!=(**atsosItr).lastResidual();++itRes,++imeas) {
307 double residual = itRes->residual();
308 double errSq = itRes->errSq();
309 (*m_unshiftedResiduals)[imeas]=
residual;
310 (*m_unshiftedResErrors)[imeas]=std::sqrt(errSq);
317 msg(MSG::ERROR)<<
"problem with nmeas, imeas="<<imeas<<
", NMEAS="<<NMEAS<<
endmsg;
318 throw std::runtime_error(
"Error in ShiftingDerivCalcTool::setUnshiftedResiduals");
322 delete refittedTrack; refittedTrack=
nullptr;
◆ shiftSize()
double ShiftingDerivCalcTool::shiftSize |
( |
const AlignPar * |
alignPar | ) |
const |
|
protected |
◆ showStatistics()
void Trk::ShiftingDerivCalcTool::showStatistics |
( |
| ) |
|
|
inlinevirtual |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_alignModuleTool
◆ m_chi2VAlignParamVec
std::vector<double**> Trk::ShiftingDerivCalcTool::m_chi2VAlignParamVec |
|
private |
◆ m_chi2VAlignParamVecMeasType
std::vector<double***> Trk::ShiftingDerivCalcTool::m_chi2VAlignParamVecMeasType |
|
private |
◆ m_chi2VAlignParamXVec
std::vector<double**> Trk::ShiftingDerivCalcTool::m_chi2VAlignParamXVec |
|
private |
◆ m_derivative_map
◆ m_detStore
◆ m_doChi2VAlignParamMeasType
bool Trk::ShiftingDerivCalcTool::m_doChi2VAlignParamMeasType |
|
private |
◆ m_doFits
bool Trk::ShiftingDerivCalcTool::m_doFits |
|
private |
◆ m_doResidualPlots
bool Trk::ShiftingDerivCalcTool::m_doResidualPlots |
|
private |
◆ m_evtStore
◆ m_fitter
◆ m_logStream
std::ostream* Trk::IDerivCalcTool::m_logStream |
|
protectedinherited |
◆ m_maxIter
int Trk::ShiftingDerivCalcTool::m_maxIter |
|
private |
◆ m_minIter
int Trk::ShiftingDerivCalcTool::m_minIter |
|
private |
◆ m_nChamberShifts
int Trk::ShiftingDerivCalcTool::m_nChamberShifts |
|
private |
◆ m_nFits
int Trk::ShiftingDerivCalcTool::m_nFits |
|
private |
◆ m_nIterations
int Trk::ShiftingDerivCalcTool::m_nIterations |
|
private |
◆ m_ntracksFailAlignParamCut
int Trk::ShiftingDerivCalcTool::m_ntracksFailAlignParamCut |
|
private |
◆ m_ntracksFailFinalAttempt
int Trk::ShiftingDerivCalcTool::m_ntracksFailFinalAttempt |
|
private |
◆ m_ntracksFailMaxIter
int Trk::ShiftingDerivCalcTool::m_ntracksFailMaxIter |
|
private |
◆ m_ntracksFailTrackRefit
int Trk::ShiftingDerivCalcTool::m_ntracksFailTrackRefit |
|
private |
◆ m_ntracksPassDerivatives
int Trk::ShiftingDerivCalcTool::m_ntracksPassDerivatives |
|
private |
◆ m_ntracksPassGetDeriv
int Trk::ShiftingDerivCalcTool::m_ntracksPassGetDeriv |
|
private |
◆ m_ntracksPassGetDerivLastPass
int Trk::ShiftingDerivCalcTool::m_ntracksPassGetDerivLastPass |
|
private |
◆ m_ntracksPassGetDerivSecPass
int Trk::ShiftingDerivCalcTool::m_ntracksPassGetDerivSecPass |
|
private |
◆ m_ntracksPassInitScan
int Trk::ShiftingDerivCalcTool::m_ntracksPassInitScan |
|
private |
◆ m_ntracksPassSetUnshiftedRes
int Trk::ShiftingDerivCalcTool::m_ntracksPassSetUnshiftedRes |
|
private |
◆ m_ntracksProcessed
int Trk::ShiftingDerivCalcTool::m_ntracksProcessed |
|
private |
◆ m_particleHypothesis
◆ m_particleNumber
int Trk::ShiftingDerivCalcTool::m_particleNumber |
|
private |
◆ m_removeScatteringBeforeRefit
bool Trk::ShiftingDerivCalcTool::m_removeScatteringBeforeRefit |
|
private |
◆ m_residualCalculator
◆ m_rotSize
double Trk::ShiftingDerivCalcTool::m_rotSize |
|
private |
◆ m_runOutlierRemoval
bool Trk::ShiftingDerivCalcTool::m_runOutlierRemoval |
|
private |
◆ m_secPass
bool Trk::ShiftingDerivCalcTool::m_secPass |
|
private |
◆ m_setMinIterations
bool Trk::ShiftingDerivCalcTool::m_setMinIterations |
|
private |
fit track with AlignModules shifted up and down in each extreme, find the number of iterations fitter uses to converge.
Set this number for all subsequent track refits.
Definition at line 146 of file ShiftingDerivCalcTool.h.
◆ m_SLTrackFitterTool
◆ m_solveOption
int Trk::IDerivCalcTool::m_solveOption = 0 |
|
privateinherited |
◆ m_tmpChi2VAlignParam
double** Trk::ShiftingDerivCalcTool::m_tmpChi2VAlignParam |
|
private |
◆ m_tmpChi2VAlignParamMeasType
double*** Trk::ShiftingDerivCalcTool::m_tmpChi2VAlignParamMeasType |
|
private |
◆ m_tmpChi2VAlignParamX
double** Trk::ShiftingDerivCalcTool::m_tmpChi2VAlignParamX |
|
private |
◆ m_trackAlignParamCut
double Trk::ShiftingDerivCalcTool::m_trackAlignParamCut |
|
private |
cut on value of track alignment parameter, determined from fit of chi2 vs.
align parameters to a quadratic
Definition at line 144 of file ShiftingDerivCalcTool.h.
◆ m_trackFitterTool
◆ m_traSize
double Trk::ShiftingDerivCalcTool::m_traSize |
|
private |
◆ m_unshiftedResErrors
Amg::VectorX* Trk::ShiftingDerivCalcTool::m_unshiftedResErrors |
|
private |
◆ m_unshiftedResiduals
Amg::VectorX* Trk::ShiftingDerivCalcTool::m_unshiftedResiduals |
|
private |
◆ m_unshiftedTrackChi2
double Trk::ShiftingDerivCalcTool::m_unshiftedTrackChi2 |
|
private |
◆ m_unshiftedTrackChi2MeasType
double* Trk::ShiftingDerivCalcTool::m_unshiftedTrackChi2MeasType |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
std::string find(const std::string &s)
return a remapped string
uint64_t eventNumber() const
The current event's event number.
DataModel_detail::iterator< DataVector > iterator
Standard iterator.
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
uint32_t runNumber() const
The current event's run number.
virtual void setOwner(IDataHandleHolder *o)=0
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
::StatusCode StatusCode
StatusCode definition for legacy code.
double chi2(TH1 *h0, TH1 *h1)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Class describing the basic event information.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
@ NumberOfMeasurementTypes
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.