22 dynamic_cast<TrKalmanNode*>(
it->second)->SetActiveFlag(
false);
37 for(
int nd=location->GetNodeCount()-1; nd>=0; nd--) {
43 if (node->
IsFired()) fired =
true;
75 for(
int fb=0; fb<2; fb++) {
79 node->
FF[fb]->
KFM(0,2) = node->
FF[fb]->
KFM(1,3) =
84 node->
FF[fb]->
KFM(0,2) = node->
FF[fb]->
KFM(1,3) =
137 for(std::set<SensitiveVolume*>::iterator
it=location->GetSensitiveVolumes().begin();
138 it != location->GetSensitiveVolumes().end();
it++) {
139 unsigned nodeWrapperCount = (*it)->GetKfNodeWrapperCount();
142 if (location->GetSensitiveVolumeNodeWrapperCount()) {
143 assert(location->GetSensitiveVolumeNodeWrapperCount() == nodeWrapperCount);
146 for(
unsigned tmpl=0; tmpl<nodeWrapperCount; tmpl++) {
148 assert((*it)->GetKfNodeWrapper(tmpl)->GetKfNodeTemplate()->IsCompatible(location->GetTemplate(tmpl)));
154 for(
unsigned tmpl=0; tmpl<nodeWrapperCount; tmpl++) {
156 location->SetNextMdimValue((*it)->GetKfNodeWrapper(tmpl)->GetMdim());
158 location->SetNextNodeToMaster((*it)->GetKfNodeWrapper(tmpl)->GetNodeToMasterMtx());
159 location->SetNextTemplate((*it)->GetKfNodeWrapper(tmpl)->GetKfNodeTemplate());
177 _RETURN_(-1,
"Failed to calculate magnet-off transport matrices!\n");
195 location->mMediaSliceArray =
224 if (!location->GetNext(fb))
continue;
228 double h = to->
GetZ() - location->GetZ();
245 if (!rk->
m1)
return -1;
252 if (!rk->
m2)
return -1;
261 if (!rk->
m2 || !rk->
m4)
return -1;
272 if (!rk->
m2 || !rk->
m3 || !rk->
m4 || !rk->
m5 || !rk->
m6)
return -1;
284 double pout[6], rkd[5][5];
291 if ((static_cast <TrKalmanNode*>(from))->
302 for(
int iq=
_X_; iq<=
_SY_; iq++)
309 for(
int iq=
_X_; iq<=
_SY_; iq++)
333 double e0_kin = sqrt(1./
SQR(invp0) +
SQR(mass)) -
mass;
336 double tx = (from->
x0->
KFV(2) + to->
x0->
KFV(2))/2.;
337 double ty = (from->
x0->
KFV(3) + to->
x0->
KFV(3))/2.;
339 double len_cff = 1. +
SQR(tx) +
SQR(ty);
347 double e1_kin = e0_kin - losses, invp1;
351 invp1 = 1./sqrt(e1_kin*(e1_kin+2.*mass));
352 if (invp0 < 0.) invp1 = -invp1;
373 for(
int iq=
_X_; iq<=
_SY_; iq++)
374 from->
Q->
KFM(
ip,iq) = 0.0;
377 if (from->
GetZ() == to->
GetZ())
return 0;
381 if (!noise)
return 0;
393 double len_cff = 1. +
SQR(tx) +
SQR(ty);
394 double cxx = len_cff*(1. +
SQR(tx));
395 double cyy = len_cff*(1. +
SQR(ty));
396 double cxy = len_cff*tx*ty;
405 double fcff = sqrt(len_cff)/
SQR(p*beta);
412 for(
int iq=
ip; iq<4; iq++)
417 for(
int iq=0; iq<
ip; iq++)
418 from->
Q->
KFM(ip,iq) = from->
Q->
KFM(iq,ip);
436 double S[4], arr[2][4][trnode->
mDim];
441 if (!trnode->
mHit)
return 0;
456 memcpy(S, trnode->
x0->
ARR(),
sizeof(S));
466 for(
int im=0; im<trnode->
mDim; im++)
477 #define _FLYSUB_TYPICAL_XY_COORD_ERROR_ ( 0.010)
478 #define _FLYSUB_TYPICAL_SLOPE_ERROR_ ( 0.0001)
481 #define _FLYSUB_TYPICAL_MOMENTUM_ERROR_ ( 1.000)
482 #define _FLYSUB_COVARIANCE_BLOWUP_CFF_ (30)