![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <TrigInDetTrackFollowingTool.h>
|
| TrigInDetTrackFollowingTool (const std::string &, const std::string &, const IInterface *) |
|
virtual StatusCode | initialize () |
|
virtual StatusCode | finalize () |
|
virtual Trk::Track * | getTrack (const std::vector< const Trk::SpacePoint * > &, const std::vector< const InDetDD::SiDetectorElement * > &, const EventContext &) const |
|
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 |
|
|
std::unique_ptr< TrigFTF_ExtendedTrackState > | fitTheSeed (const std::vector< const Trk::SpacePoint * > &, MagField::AtlasFieldCache &) const |
|
const Trk::PrepRawData * | updateTrackState (const InDet::PixelCluster *, const InDet::PixelClusterCollection *, TrigFTF_ExtendedTrackState &) const |
|
const Trk::PrepRawData * | updateTrackState (const InDet::SCT_Cluster *, const InDet::SCT_ClusterCollection *, int, TrigFTF_ExtendedTrackState &) const |
|
int | extrapolateTrackState (TrigFTF_ExtendedTrackState &, const Trk::PlaneSurface *, MagField::AtlasFieldCache &) const |
|
int | RungeKutta34 (double *, double *, const Trk::PlaneSurface *, MagField::AtlasFieldCache &, bool) const |
|
bool | checkIntersection (double const *, const Trk::PlaneSurface *, const Trk::PlaneSurface *, MagField::AtlasFieldCache &) const |
|
double | processHit (const InDet::PixelCluster *, double *, double *, const TrigFTF_ExtendedTrackState &) const |
|
double | processHit (const InDet::SCT_Cluster *, int, double &, double &, double *, const TrigFTF_ExtendedTrackState &) const |
|
void | crossProduct (double const *, double const *, double *) const |
|
double | estimateRK_Step (const Trk::PlaneSurface *, double const *) const |
|
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...
|
|
|
Gaudi::Property< int > | m_nClustersMin {this, "nClustersMin", 7, "Minimum number of clusters on track"} |
|
Gaudi::Property< int > | m_nHolesMax {this, "nHolesMax", 3, "Maximum number of holes on track"} |
|
Gaudi::Property< double > | m_maxChi2Dist_Pixels {this, "Chi2MaxPixels", 50.0, "the Pixel hit chi2 cut"} |
|
Gaudi::Property< double > | m_maxChi2Dist_Strips {this, "Chi2MaxStrips", 150.0, "the Strip hit chi2 cut"} |
|
Gaudi::Property< bool > | m_useHitErrors {this, "UseHitErrors", false, "use PrepRawData errors"} |
|
Gaudi::Property< bool > | m_useDetectorThickness {this, "UseDetectorThickness", false, "get Si-modules thickness from InDet Geometry"} |
|
Gaudi::Property< double > | m_nominalRadLength {this, "ModuleRadLength", 0.05, "fixed radiation thickness of the detector modules"} |
|
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > | m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"} |
|
SG::ReadHandleKey< InDet::PixelClusterContainer > | m_pixcontainerkey {this, "PixelClusterContainer","ITkPixelClusters"} |
|
SG::ReadHandleKey< InDet::SCT_ClusterContainer > | m_sctcontainerkey {this, "SCT_ClusterContainer", "ITkStripClusters"} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
◆ StoreGateSvc_t
◆ TrigInDetTrackFollowingTool()
TrigInDetTrackFollowingTool::TrigInDetTrackFollowingTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ checkIntersection()
Definition at line 1101 of file TrigInDetTrackFollowingTool.cxx.
1103 const double C = 299.9975;
1104 const double minStep = 100.0;
1105 const double bound_tol = 0.2;
1109 memcpy(&Re[0], &Rk[0],
sizeof(Re));
1113 double Ax[3] = {Trf(0,0),Trf(1,0),Trf(2,0)};
1115 double Ay[3] = {Trf(0,1),Trf(1,1),Trf(2,1)};
1119 gP[0] = Trf(0,3) + Ax[0]*Re[0] + Ay[0]*Re[1];
1120 gP[1] = Trf(1,3) + Ax[1]*Re[0] + Ay[1]*Re[1];
1121 gP[2] = Trf(2,3) + Ax[2]*Re[0] + Ay[2]*Re[1];
1126 sincos(Re[2], &sinf, &cosf);
1127 sincos(Re[3], &sint, &
cost);
1129 double gV[3] = {cosf*sint, sinf*sint,
cost};
1134 double D[4] = {normal[0], normal[1], normal[2], 0.0};
1136 for(
int i=0;
i<3;
i++) D[3] += -normal[
i]*center[
i];
1138 double CQ =
C*Re[4];
1144 double c = D[0]*gP[0] + D[1]*gP[1] + D[2]*gP[2] + D[3];
1145 double b = D[0]*gV[0] + D[1]*gV[1] + D[2]*gV[2];
1146 double a = 0.5*CQ*(gB[0]*(D[1]*gV[2]-D[2]*gV[1]) + gB[1]*(D[2]*gV[0]-D[0]*gV[2]) + gB[2]*(D[0]*gV[1]-D[1]*gV[0]));
1150 bool useExpansion = std::fabs(
ratio)<0.1;
1160 double discr =
b*
b-4.0*
a*
c;
1166 int signb = (
b<0.0)?-1:1;
1167 sl = (-
b + signb*std::sqrt(discr))/(2*
a);
1172 if(std::fabs(sl)>=minStep) {
1173 nStepMax = (
int)(std::fabs(sl)/minStep)+1;
1176 if((nStepMax<0)||(nStepMax>100)) {
1181 double Ac = 0.5*sl*Av;
1182 double DVx = gV[1]*gB[2] - gV[2]*gB[1];
1183 double DVy = gV[2]*gB[0] - gV[0]*gB[2];
1184 double DVz = gV[0]*gB[1] - gV[1]*gB[0];
1186 double E[3] = {gP[0]+gV[0]*sl+Ac*DVx, gP[1]+gV[1]*sl+Ac*DVy, gP[2]+gV[2]*sl+Ac*DVz};
1189 for(
int i=0;
i<3;
i++) gP[
i] =
E[
i];
1196 double inv_step = 1/sl;
1198 double dBds[3] = {inv_step*(gBe[0]-gB[0]),inv_step*(gBe[1]-gB[1]),inv_step*(gBe[2]-gB[2])};
1200 int nStep = nStepMax;
1204 c = D[0]*gP[0] + D[1]*gP[1] + D[2]*gP[2] + D[3];
1205 b = D[0]*gV[0] + D[1]*gV[1] + D[2]*gV[2];
1206 a = 0.5*CQ*(gB[0]*(D[1]*gV[2]-D[2]*gV[1])+gB[1]*(D[2]*gV[0]-D[0]*gV[2])+gB[2]*(D[0]*gV[1]-D[1]*gV[0]));
1209 useExpansion = std::fabs(
ratio) < 0.1;
1216 double discr=
b*
b-4.0*
a*
c;
1220 int signb = (
b<0.0)?-1:1;
1221 sl = (-
b+signb*std::sqrt(discr))/(2*
a);
1224 double ds = sl/nStep;
1228 DVx = gV[1]*gB[2] - gV[2]*gB[1];
1229 DVy = gV[2]*gB[0] - gV[0]*gB[2];
1230 DVz = gV[0]*gB[1] - gV[1]*gB[0];
1232 E[0] = gP[0] + gV[0]*
ds + Ac*DVx;
1233 E[1] = gP[1] + gV[1]*
ds + Ac*DVy;
1234 E[2] = gP[2] + gV[2]*
ds + Ac*DVz;
1238 V[0] = gV[0] + Av*DVx;
1239 V[1] = gV[1] + Av*DVy;
1240 V[2] = gV[2] + Av*DVz;
1242 for(
int i=0;
i<3;
i++) {
1243 gV[
i] = V[
i];gP[
i] =
E[
i];
1246 for(
int i=0;
i<3;
i++) gB[
i] += dBds[
i]*
ds;
1256 const double* Ax2 = Trf2.matrix().col(0).data();
1257 const double* Ay2 = Trf2.matrix().col(1).data();
1259 const double d[3] = { gP[0] - Trf2(0, 3), gP[1] - Trf2(1, 3), gP[2] - Trf2(2, 3) };
1261 double locX =
d[0] * Ax2[0] +
d[1] * Ax2[1] +
d[2] * Ax2[2];
1262 double locY =
d[0] * Ay2[0] +
d[1] * Ay2[1] +
d[2] * Ay2[2];
1265 if(!pDE)
return false;
◆ crossProduct()
void TrigInDetTrackFollowingTool::crossProduct |
( |
double const * |
B, |
|
|
double const * |
V, |
|
|
double * |
A |
|
) |
| const |
|
inlineprivate |
◆ 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);
◆ 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.
◆ 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.
◆ 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]
◆ detStore()
◆ estimateRK_Step()
Definition at line 1275 of file TrigInDetTrackFollowingTool.cxx.
1281 Step = -(P[0]*P[3] + P[1]*P[4])/(1 - P[5]*P[5]);
1290 for(
int i=0;
i<3;
i++) D += -normal[
i]*center[
i];
1295 for(
int i=0;
i<3;
i++) {
1296 a += normal[
i]*P[
i+3];
1297 Sum += normal[
i]*P[
i];
1299 if(
a==0.0)
return Step;
◆ 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
◆ extrapolateTrackState()
Definition at line 938 of file TrigInDetTrackFollowingTool.cxx.
942 memcpy(&Re[0], &ETS.
m_Xk[0],
sizeof(Re));
947 memset(&P[0],0,
sizeof(P));
950 double Ax[3] = {Trf(0,0),Trf(1,0),Trf(2,0)};
951 double Ay[3] = {Trf(0,1),Trf(1,1),Trf(2,1)};
954 gP[0] = Trf(0,3) + Ax[0]*Re[0] + Ay[0]*Re[1];
955 gP[1] = Trf(1,3) + Ax[1]*Re[0] + Ay[1]*Re[1];
956 gP[2] = Trf(2,3) + Ax[2]*Re[0] + Ay[2]*Re[1];
961 sincos(Re[2], &sinf, &cosf);
962 sincos(Re[3], &sint, &
cost);
964 double gV[3] = {cosf*sint, sinf*sint,
cost};
966 memset(&Jm[0],0,
sizeof(Jm));
973 for(
int i=0;
i<3;
i++) {
992 memset(&J[0],0,
sizeof(J));
995 memset(&BigP[0],0,
sizeof(BigP));
997 for(
int i=0;
i<7;
i++) BigP[
i] = P[
i];
998 for(
int i=0;
i<35;
i++) BigP[
i+7] = Jm[
i];
1008 const double* Az = Trf.matrix().col(2).data();
1012 double lV = Az[0]*gV[0] + Az[1]*gV[1] + Az[2]*gV[2];
1014 double xOverX0 = 0.0;
1026 double radLength = xOverX0/std::fabs(lV);
1028 double sigmaMS = 13.6 * std::fabs(Re[4]) * std::sqrt(radLength) * (1.0 + 0.038 *
std::log(radLength));
1029 double s2 = sigmaMS * sigmaMS;
1030 double a = 1.0 / sint;
1035 ETS.
m_Gk[2][2] +=
s2 * a2;
1042 ETS.
m_Gk[4][4] += Re[4] * Re[4] * radLength * (0.415 - 0.744 * radLength);
1048 memset(&Be[0][0],0,
sizeof(Be));
1050 for(
int i=0;
i<4;
i++) {
1051 for(
int j=0;j<5;j++) {
1052 for(
int k=0;
k<5;
k++) Be[
i][j] += J[
k+
i*5]*ETS.
m_Gk[
k][j+5];
1055 for(
int j=0;j<5;j++) {
1056 Be[4][j] = ETS.
m_Gk[4][j+5];
1062 memset(&JC[0][0],0,
sizeof(JC));
1063 memset(&Ce[0][0],0,
sizeof(Ce));
1065 for(
int i=0;
i<4;
i++) {
1066 for(
int j=0;j<5;j++) {
1067 for(
int k=0;
k<5;
k++) JC[
i][j] += J[
k+
i*5]*ETS.
m_Gk[
k][j];
1070 for(
int j=0;j<5;j++) {
1071 JC[4][j] = ETS.
m_Gk[4][j];
1074 for(
int i=0;
i<5;
i++) {
1075 for(
int j=0;j<=
i;j++) {
1077 for(
int k=0;
k<5;
k++) Ce[
i][j] += JC[
i][
k]*J[
k+j*5];
1078 Ce[j][
i] = Ce[
i][j];
1081 Ce[
i][4] = Ce[4][
i] = JC[
i][4];
1090 for(
int i=0;
i<5;
i++) {
1092 for(
int j=0;j<5;j++) {
1093 ETS.
m_Gk[
i][j] = Ce[
i][j];
1094 ETS.
m_Gk[
i][j+5] = Be[
i][j];
1095 ETS.
m_Gk[j+5][
i] = Be[
i][j];
◆ finalize()
StatusCode TrigInDetTrackFollowingTool::finalize |
( |
| ) |
|
|
virtual |
◆ fitTheSeed()
Definition at line 405 of file TrigInDetTrackFollowingTool.cxx.
417 double dsp[2] = {
pe[0]-
pb[0],
pe[1]-
pb[1]};
418 double Lsp = std::sqrt(dsp[0]*dsp[0] + dsp[1]*dsp[1]);
419 double cosA = dsp[0]/Lsp;
420 double sinA = dsp[1]/Lsp;
423 double dxm = pm[0] -
pb[0];
424 double dym = pm[1] -
pb[1];
426 double x1 = dxm*cosA + dym*sinA;
427 double m1 = -dxm*sinA + dym*cosA;
429 double a_parab = -2*
m1/(
x1*(Lsp-
x1));
430 double b_parab = -0.5*a_parab*Lsp;
432 double Rx[3] = {0,b_parab,a_parab};
433 double Ry[2] = {
pb[2],tau0};
438 memset(&Cx[0][0],0,
sizeof(Cx));
443 memset(&Cy[0][0],0,
sizeof(Cy));
454 memset(&
Fx[0][0],0,
sizeof(
Fx));
459 memset(&
Fy[0][0],0,
sizeof(
Fy));
466 for(
const auto& sp : seed) {
470 double pk[3] = {sp->globalPosition().x(), sp->globalPosition().y(), sp->globalPosition().z()};
472 double dx = pk[0] -
pb[0];
473 double dy = pk[1] -
pb[1];
475 double dist =
dx*cosA +
dy*sinA;
476 double measx =-
dx*sinA +
dy*cosA;
477 double measy = pk[2];
483 double rk = sp->globalPosition().perp();
497 double Rex[3] = {Rx[0], Rx[1], Rx[2]};
499 Rex[0] +=
Fx[0][1]*Rx[1] +
Fx[0][2]*Rx[2];
500 Rex[1] +=
Fx[1][2]*Rx[2];
502 double Cex[3][3], CFT[3][3];
504 for(
int i=0;
i<3;
i++) {
505 for(
int j=0;j<3;j++) {
507 for(
int m=0;
m<3;
m++) CFT[
i][j] += Cx[
i][
m]*
Fx[j][
m];
510 for(
int i=0;
i<3;
i++) {
511 for(
int j=0;j<3;j++) {
513 for(
int m=0;
m<3;
m++) Cex[
i][j] +=
Fx[
i][
m]*CFT[
m][j];
517 double Rey[2] = {Ry[0], Ry[1]};
519 Rey[0] +=
Fy[0][1]*Ry[1];
523 for(
int i=0;
i<2;
i++) {
524 for(
int j=0;j<2;j++) {
526 for(
int m=0;
m<2;
m++) CFT[
i][j] += Cy[
i][
m]*
Fy[j][
m];
529 for(
int i=0;
i<2;
i++) {
530 for(
int j=0;j<2;j++) {
532 for(
int m=0;
m<2;
m++) Cey[
i][j] +=
Fy[
i][
m]*CFT[
m][j];
538 double CHTx[3] = {Cex[0][0], Cex[0][1], Cex[0][2]};
539 double Dx = 1/(Cex[0][0] + sigma_x2);
541 double resid = measx - Rex[0];
543 double Kx[3] = {Dx*CHTx[0], Dx*CHTx[1], Dx*CHTx[2]};
545 for(
int i=0;
i<3;
i++) Rx[
i] = Rex[
i] + Kx[
i]*resid;
546 for(
int i=0;
i<3;
i++) {
547 for(
int j=0;j<3;j++) {
548 Cx[
i][j] = Cex[
i][j] - Kx[
i]*CHTx[j];
552 double CHTy[2] = {Cey[0][0], Cey[0][1]};
553 double Dy = 1/(Cey[0][0] + sigma_y2);
555 resid = measy - Rey[0];
557 double Ky[2] = {Dy*CHTy[0], Dy*CHTy[1]};
559 for(
int i=0;
i<2;
i++) Ry[
i] = Rey[
i] + Ky[
i]*resid;
560 for(
int i=0;
i<2;
i++) {
561 for(
int j=0;j<2;j++) {
562 Cy[
i][j] = Cey[
i][j] - Ky[
i]*CHTy[j];
579 if(thePlane ==
nullptr)
return nullptr;
583 P0[2] = std::atan2(sinA - Rx[1]*cosA, cosA - Rx[1]*sinA);
584 P0[3] = std::atan2(1, Ry[1]);
585 double coeff = 1.0/(300.0*B0[2]*std::sqrt(1+Ry[1]*Ry[1]));
586 P0[4] = -Rx[2]*coeff;
587 P0[5] = Cx[2][2]*coeff*coeff;
589 return std::make_unique<TrigFTF_ExtendedTrackState>(P0, thePlane);
◆ getTrack()
Implements ITrigInDetTrackFollowingTool.
Definition at line 593 of file TrigInDetTrackFollowingTool.cxx.
600 if (!fieldCondObj.isValid()) {
605 fieldCondObj->getInitializedCache (fieldCache);
611 if (!pixcontainer.isValid()) {
620 if (!sctcontainer.isValid()) {
631 std::vector<const Trk::PrepRawData*> assignedHits(
nModules,
nullptr);
633 std::vector<int> moduleStatus(
nModules, 0);
635 unsigned int seedSize =
seed.size();
637 std::vector<unsigned int> seedHashes(seedSize,0);
639 for(
unsigned int spIdx=0;spIdx<seedSize;spIdx++) {
646 int nUnassigned = seedSize;
648 int startModuleIdx = -1;
650 for(
int moduleIdx = 0;moduleIdx<
nModules;moduleIdx++) {
651 unsigned int hash = road.at(moduleIdx)->identifyHash();
652 for(
unsigned int spIdx=0;spIdx<seedSize;spIdx++) {
653 if(seedHashes[spIdx] !=
hash)
continue;
655 assignedHits[moduleIdx] =
seed.at(spIdx)->clusterList().first;
656 moduleStatus[moduleIdx] = 1;
658 startModuleIdx = moduleIdx;
662 if(nUnassigned == 0)
break;
665 if(nUnassigned > 0)
return nullptr;
667 std::unique_ptr<TrigFTF_ExtendedTrackState> initialState =
fitTheSeed(seed, fieldCache);
669 if(initialState ==
nullptr)
return nullptr;
675 std::vector<int> moduleIndexSequence(
nModules);
679 for(
int moduleIdx = startModuleIdx + 1;moduleIdx<
nModules;moduleIdx++, modCounter++) {
680 moduleIndexSequence[modCounter] = moduleIdx;
682 for(
int moduleIdx = startModuleIdx;moduleIdx>=0;moduleIdx--, modCounter++) {
683 moduleIndexSequence[modCounter] = moduleIdx;
688 for(
auto const moduleIdx : moduleIndexSequence) {
694 if(moduleStatus[moduleIdx] < 0)
continue;
702 if(moduleIdx == startModuleIdx) {
709 if(pPRD ==
nullptr) {
713 moduleStatus[moduleIdx] = -2;
722 moduleStatus[moduleIdx] = -2;
723 if(pPRD !=
nullptr) {
734 unsigned int nHits = 0;
743 if(pPRD ==
nullptr) {
744 if(p_pixcontainer !=
nullptr) {
745 clustersOnElement = (*p_pixcontainer).indexFindPtr(moduleHash);
746 if(clustersOnElement !=
nullptr) {
747 nHits = clustersOnElement->size();
766 if(pPRD ==
nullptr) {
767 if(p_sctcontainer !=
nullptr) {
768 clustersOnElement = (*p_sctcontainer).indexFindPtr(moduleHash);
769 if(clustersOnElement !=
nullptr) {
770 nHits = clustersOnElement->size();
787 moduleStatus[moduleIdx] = -3;
791 if(pPRD ==
nullptr) {
792 if(selectedHit ==
nullptr) {
794 moduleStatus[moduleIdx] = -4;
797 assignedHits[moduleIdx] = selectedHit;
798 moduleStatus[moduleIdx] = de->
isPixel() ? 2 : 3;
807 double chi2tot = theState.
m_chi2;
823 int ndoftot = theState.
m_ndof;
829 double z0 = theState.
m_Xk[1];
830 double d0 = theState.
m_Xk[0];
832 bool bad_cov =
false;
836 for(
int i=0;
i<5;
i++) {
837 for(
int j=0;j<=
i;j++) {
838 double c = theState.
m_Gk[
i][j];
839 if (
i == j &&
c < 0) {
841 ATH_MSG_DEBUG(
"REGTEST: cov(" <<
i <<
"," <<
i <<
") =" <<
c <<
" < 0, reject track");
844 cov.fillSymmetric(
i,j,
c);
848 if((ndoftot<0) || (fabs(
pt)<100.0) || (std::isnan(
pt)) || bad_cov) {
849 ATH_MSG_DEBUG(
"Track following failed - possibly floating point problem");
857 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> perType;
860 auto pParVec = std::make_unique<Trk::TrackStates>();
862 pParVec->reserve(50);
865 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> rioType(0);
873 if(pPRD ==
nullptr)
continue;
881 if(pPS==
nullptr)
continue;
891 std::unique_ptr<Trk::MeasurementBase> pRIO{};
896 pRIO = std::make_unique<InDet::PixelClusterOnTrack>(pPixel, std::move(locPos),
Amg::MatrixX(
cov),
903 pRIO = std::make_unique<InDet::SCT_ClusterOnTrack>(pStrip, std::move(locPos),
Amg::MatrixX(
cov),
911 for(
int i=0;
i<5;
i++) {
912 for(
int j=0;j<=
i;j++) {
913 pM.fillSymmetric(
i,j,
ha.m_Ck[
idx++]);
923 pParVec->push_back(pTSS);
926 auto pFQ = std::make_unique<Trk::FitQuality>(chi2tot, ndoftot);
◆ initialize()
StatusCode TrigInDetTrackFollowingTool::initialize |
( |
| ) |
|
|
virtual |
◆ 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()
static const InterfaceID& ITrigInDetTrackFollowingTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ 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.
◆ processHit() [1/2]
Definition at line 186 of file TrigInDetTrackFollowingTool.cxx.
188 double cluster_cov[2];
196 cluster_cov[1] = pPRD->
width().
z();
197 for(
int i=0;
i<2;
i++) cluster_cov[
i] *= cluster_cov[
i]/12.0;
200 double covsum[2][2] = {{ets.
m_Gk[0][0] + cluster_cov[0], ets.
m_Gk[0][1]}, {ets.
m_Gk[0][1], ets.
m_Gk[1][1] + cluster_cov[1]}};
202 double detr = 1/(covsum[0][0]*covsum[1][1] - covsum[0][1]*covsum[1][0]);
204 invcov[0] = detr*covsum[1][1];
205 invcov[1] = -detr*covsum[1][0];
206 invcov[2] = detr*covsum[0][0];
211 return (resid[0]*(resid[0]*invcov[0] + resid[1]*invcov[1]) + resid[1]*(resid[0]*invcov[1] + resid[1]*invcov[2]));
◆ processHit() [2/2]
Definition at line 215 of file TrigInDetTrackFollowingTool.cxx.
228 invcov = 1/(ets.
m_Gk[0][0] + covX);
244 sincos(
beta, &sinB, &cosB);
246 resid = (meas_x - ets.
m_Xk[0])*cosB + (meas_y - ets.
m_Xk[1])*sinB;
251 double track_cov = cosB*cosB*(ets.
m_Gk[0][0]+e00) + 2*cosB*sinB*(ets.
m_Gk[0][1]+e01) + sinB*sinB*(ets.
m_Gk[1][1]+e11);
253 invcov = 1/track_cov;
256 return (resid * resid * invcov);
◆ renounce()
◆ renounceArray()
◆ RungeKutta34()
Definition at line 1306 of file TrigInDetTrackFollowingTool.cxx.
1308 const double coeff = 299.7;
1309 const double min_step = 3.0;
1310 const double const_field_step = 30.0;
1311 const double maxPath = 3000.0;
1312 const double minQp = 0.01;
1313 const double minRad = 300.0;
1315 const int maxIter = 10;
1317 double exStep = 0.0;
1319 if(std::fabs(P[6]) > minQp)
return -1;
1323 if(Step > 1e7)
return -2;
1325 double absStep = fabs(Step);
1327 if(absStep <= min_step) {
1328 for(
int i=0;
i<3;
i++) P[
i] += Step*P[
i+3];
1333 if(fabs(P[6]*Step) > minRad) {
1334 Step = (Step > 0.0 ? minRad : -minRad)/fabs(P[6]);
1343 memcpy(&
Y[0], P,
sizeof(
Y));
1349 for(
int i=0;
i<3;
i++)
B[
i] *= coeff;
1352 if(absStep > fabs(exStep))
1356 for(
int iter=0;iter<maxIter;iter++) {
1358 bool useConstField = fabs(Step) < const_field_step;
1360 if(!useConstField) {
1362 for(
int i=0;
i<3;
i++)
B[
i] *= coeff;
1365 double B2[3], B3[3];
1373 double H3mom =
mom*H3;
1374 double H23mom =
mom*H23;
1375 double H4mom =
mom*H4;
1376 double H34mom =
mom*H34;
1386 for(
int i=0;
i<3;
i++) Y2[
i] =
Y[
i] + H3*
Y[
i+3];
1387 for(
int i=3;
i<6;
i++) Y2[
i] =
Y[
i] + H3mom*YB[
i-3];
1396 for(
int i=0;
i<3;
i++) B2[
i] *= coeff;
1404 for(
int i=0;
i<3;
i++) Y3[
i] =
Y[
i] + H23*Y2[
i+3];
1405 for(
int i=3;
i<6;
i++) Y3[
i] =
Y[
i] + H23mom*YB2[
i-3];
1414 for(
int i=0;
i<3;
i++) B3[
i] *= coeff;
1420 for(
int i=3;
i<6;
i++) Y1[
i-3] =
Y[
i-3] + H4*(
Y[
i] + 3*Y3[
i]);
1421 for(
int i=0;
i<3;
i++) Y1[
i+3] =
Y[
i+3] + H4mom*(YB[
i] + 3*YB3[
i]);
1423 if(fabs(Y1[5])>1)
return -10;
1429 double J1C[9], L2C[9], J2C[9], L3C[9], J3C[9];
1435 if(!useConstField) {
1436 for(
int i=0;
i<3;
i++) CqBH3[
i] = H3mom*
B[
i];
1437 for(
int i=0;
i<3;
i++) CqB2H23[
i] = H23mom*B2[
i];
1438 for(
int i=0;
i<3;
i++) CqB3H34[
i] = H34mom*B3[
i];
1441 for(
int i=0;
i<3;
i++) CqBH3[
i] = H3mom*
B[
i];
1442 for(
int i=0;
i<3;
i++) CqB2H23[
i] = H23mom*
B[
i];
1443 for(
int i=0;
i<3;
i++) CqB3H34[
i] = H34mom*
B[
i];
1454 L2C[0] = J[17] + J1C[0];
1455 L2C[1] = J[18] + J1C[1];
1456 L2C[2] = J[19] + J1C[2];
1458 L2C[3] = J[24] + J1C[3];
1459 L2C[4] = J[25] + J1C[4];
1460 L2C[5] = J[26] + J1C[5];
1462 L2C[6] = J[31] + J1C[6];
1463 L2C[7] = J[32] + J1C[7];
1464 L2C[8] = J[33] + J1C[8];
1470 J2C[6] += H23*YB2[0];
1471 J2C[7] += H23*YB2[1];
1472 J2C[8] += H23*YB2[2];
1474 L3C[0] = J[17] + J2C[0];
1475 L3C[1] = J[18] + J2C[1];
1476 L3C[2] = J[19] + J2C[2];
1478 L3C[3] = J[24] + J2C[3];
1479 L3C[4] = J[25] + J2C[4];
1480 L3C[5] = J[26] + J2C[5];
1482 L3C[6] = J[31] + J2C[6];
1483 L3C[7] = J[32] + J2C[7];
1484 L3C[8] = J[33] + J2C[8];
1490 J3C[6] += H34*YB3[0];
1491 J3C[7] += H34*YB3[1];
1492 J3C[8] += H34*YB3[2];
1494 for(
int i=0;
i<9;
i++) J1C[
i] = 0.75*J1C[
i] + J3C[
i];
1496 for(
int i=0;
i<9;
i++) J2C[
i] *= H34;
1538 if(fabs(P[7]) > maxPath)
return -3;
1540 double norm = 1/std::sqrt(Y1[3]*Y1[3]+Y1[4]*Y1[4]+Y1[5]*Y1[5]);
1546 if(newStep > 1e7)
return -4;
1548 double absNewStep = fabs(newStep);
1550 if(absNewStep <= min_step) {
1553 if(!useConstField) {
1561 for(
int i=0;
i<3;
i++) {
1563 P[
i] = Y1[
i] + newStep*Y1[
i+3];
1570 double absStep = fabs(Step);
1572 if(Step*newStep < 0.0) {
1573 if(++nFlips > 2)
return -5;
1574 Step = absNewStep < absStep ? newStep : -Step;
1577 if(absNewStep < absStep) Step = newStep;
1580 for(
int i=0;
i<6;
i++)
Y[
i] = Y1[
i];
◆ 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.
◆ updateTrackState() [1/2]
Definition at line 261 of file TrigInDetTrackFollowingTool.cxx.
264 if(pColl ==
nullptr && pInputHit ==
nullptr)
return nullptr;
268 if(pColl !=
nullptr) {
272 for(
const auto pPRD : *pColl) {
274 double dchi2 =
processHit(pPRD, resid, invcov, ets);
276 if(dchi2 < bestChi2Dist) {
278 bestChi2Dist = dchi2;
283 if(bestHit ==
nullptr)
return bestHit;
287 double dchi2 =
processHit(pPRD, resid, invcov, ets);
291 for(
int i=0;
i<10;
i++) {
292 CHT[
i][0] = ets.
m_Gk[
i][0];
293 CHT[
i][1] = ets.
m_Gk[
i][1];
297 double V[2][2] = {{invcov[0], invcov[1]}, {invcov[1], invcov[2]}};
299 for(
int i=0;
i<10;
i++)
300 for(
int j=0;j<2;j++)
Gain[
i][j] = CHT[
i][0]*V[0][j] + CHT[
i][1]*V[1][j];
302 for(
int i=0;
i<10;
i++) {
305 for(
int j=0;j<=
i;j++) {
311 ets.
AddHit(pPRD, dchi2, 2);
◆ updateTrackState() [2/2]
Definition at line 317 of file TrigInDetTrackFollowingTool.cxx.
320 if(pColl ==
nullptr && pInputHit ==
nullptr)
return nullptr;
321 double resid, invcov;
324 if(pColl && !pColl->empty()) {
328 for(
const auto pPRD : *pColl) {
330 double dchi2 =
processHit(pPRD, shape, resid, invcov,
H, ets);
332 if(dchi2 < bestChi2Dist) {
334 bestChi2Dist = dchi2;
339 if(bestHit ==
nullptr)
return bestHit;
347 dchi2 =
processHit(pPRD, shape, resid, invcov,
H, ets);
349 double CHT[10],
Gain[10];
351 for(
int i=0;
i<10;
i++) {
353 Gain[
i] = CHT[
i] * invcov;
356 for(
int i=0;
i<10;
i++) {
358 for(
int j=0;j<=
i;j++) {
368 double stripHalfLength = std::sqrt(3*covY);
370 double dY = ets.
m_Xk[1] - stripCentre;
372 if(dY > stripHalfLength) {
373 ets.
m_Xk[1] = stripCentre + stripHalfLength;
376 if(dY < -stripHalfLength) {
377 ets.
m_Xk[1] = stripCentre - stripHalfLength;
382 dchi2 =
processHit(pPRD, shape, resid, invcov,
H, ets);
384 double CHT[10],
Gain[10];
386 for(
int i=0;
i<10;
i++) {
388 Gain[
i] = CHT[
i] * invcov;
391 for(
int i=0;
i<10;
i++) {
393 for(
int j=0;j<=
i;j++) {
400 ets.
AddHit(pPRD, dchi2, 1);
◆ updateVHKA()
◆ m_detStore
◆ m_evtStore
◆ m_fieldCondObjInputKey
◆ m_maxChi2Dist_Pixels
Gaudi::Property<double> TrigInDetTrackFollowingTool::m_maxChi2Dist_Pixels {this, "Chi2MaxPixels", 50.0, "the Pixel hit chi2 cut"} |
|
private |
◆ m_maxChi2Dist_Strips
Gaudi::Property<double> TrigInDetTrackFollowingTool::m_maxChi2Dist_Strips {this, "Chi2MaxStrips", 150.0, "the Strip hit chi2 cut"} |
|
private |
◆ m_nClustersMin
Gaudi::Property<int> TrigInDetTrackFollowingTool::m_nClustersMin {this, "nClustersMin", 7, "Minimum number of clusters on track"} |
|
private |
◆ m_nHolesMax
Gaudi::Property<int> TrigInDetTrackFollowingTool::m_nHolesMax {this, "nHolesMax", 3, "Maximum number of holes on track"} |
|
private |
◆ m_nominalRadLength
Gaudi::Property<double> TrigInDetTrackFollowingTool::m_nominalRadLength {this, "ModuleRadLength", 0.05, "fixed radiation thickness of the detector modules"} |
|
private |
◆ m_pixcontainerkey
◆ m_sctcontainerkey
◆ m_useDetectorThickness
Gaudi::Property<bool> TrigInDetTrackFollowingTool::m_useDetectorThickness {this, "UseDetectorThickness", false, "get Si-modules thickness from InDet Geometry"} |
|
private |
◆ m_useHitErrors
Gaudi::Property<bool> TrigInDetTrackFollowingTool::m_useHitErrors {this, "UseHitErrors", false, "use PrepRawData errors"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
int cost(std::vector< std::string > &files, node &n, const std::string &directory="", bool deleteref=false, bool relocate=false)
Contains information about the 'fitter' of this track.
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
const Trk::PlaneSurface * m_pS
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
double thickness() const
Method which returns thickness of the silicon wafer.
path
python interpreter configuration --------------------------------------—
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
SiIntersect inDetector(const Amg::Vector2D &localPosition, double phiTol, double etaTol) const
Test that it is in the active region.
Eigen::Matrix< double, 2, 1 > Vector2D
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual DetectorShape shape() const
Shape of element.
Scalar theta() const
theta method
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
Trk::Surface & surface()
Element Surface.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Trk::PrepRawDataContainer< SCT_ClusterCollection > SCT_ClusterContainer
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
const std::string & key() const
Return the StoreGate ID for the referenced object.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
#define AmgSymMatrix(dim)
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
GeoGenfun::FunctionNoop Fx(double r, GeoGenfun::GENFUNCTION G, const double Cenx[], const double Ceny[])
void transformGlobalToLocal(double *ATH_RESTRICT, double *ATH_RESTRICT)
virtual void setOwner(IDataHandleHolder *o)=0
void AddHit(const Trk::PrepRawData *, double, int)
Eigen::Affine3d Transform3D
virtual const Surface & surface() const =0
Return surface associated with this detector element.
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool gangedPixel() const
return the flag of this cluster containing a gangedPixel
represents the track state (measurement, material, fit parameters and quality) at a surface.
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - charged.
const Amg::Vector2D & localPosition() const
return the local position reference
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
const Amg::Vector3D & globalPosition() const
return global position reference
GeoGenfun::FunctionNoop Fy(double r, GeoGenfun::GENFUNCTION G, const double Cenx[], const double Ceny[])
const InDet::SiWidth & width() const
return width class reference
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - charged.
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
std::list< TrigFTF_HitAssignment > m_track
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
virtual IdentifierHash identifyHash() const =0
Identifier hash.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
Trk::PrepRawDataCollection< SCT_Cluster > SCT_ClusterCollection
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...