BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ExtMucKal Class Reference

#include <ExtMucKal.h>

Public Member Functions

 ExtMucKal ()
 ~ExtMucKal ()
bool ExtMucFilter ()
void SetPosMomErr (Hep3Vector pos, Hep3Vector mom, HepSymMatrix err)
void SetMucDigiCol (MucDigiCol *amucdigi)
void SetMucWindow (int aMucWindow)
void SetGapID (Hep3Vector id)
bool MucKalIniti ()
void XPmod (Hep3Vector &pos, Hep3Vector &mom, HepSymMatrix &err)
bool JCB ()
double Fit (Hep3Vector &pos, Hep3Vector &mom, HepSymMatrix &err)
HepMatrix GetRoationMatrix (MucGeoGap *box)
bool GetFilterStatus ()
double GetChi2 ()
double GetDistance (const MucRecHit *hit)
double GetPull ()
int GetOrient ()
Hep3Vector GetHitGap ()
vector< MucRecHit * > GapHit ()
vector< MucRecHit * > TrackHit ()
bool GetSameStrip ()

Detailed Description

Definition at line 16 of file ExtMucKal.h.

Constructor & Destructor Documentation

◆ ExtMucKal()

ExtMucKal::ExtMucKal ( )

Definition at line 10 of file ExtMucKal.cxx.

11 : FilterOK( false )
12 , Chi2_sub( -1 )
13 , HitExist( false )
14 , m_jcb( 6, 6, 0 )
15 , m_samestrip( false )
16 , n_sigm( 6 ) {
17 ;
18}

◆ ~ExtMucKal()

ExtMucKal::~ExtMucKal ( )

Definition at line 20 of file ExtMucKal.cxx.

20{ ; }

Member Function Documentation

◆ ExtMucFilter()

bool ExtMucKal::ExtMucFilter ( )

Definition at line 22 of file ExtMucKal.cxx.

22 {
23
24 if ( !HitExist )
25 {
26 FilterOK = false;
27 return FilterOK;
28 }
29 m_samestrip = m_gapid[0] == m_nearesthit->Part() && m_gapid[1] == m_nearesthit->Seg() &&
30 m_gapid[2] == m_nearesthit->Gap() && m_iStrip == m_nearesthit->Strip();
31 // cout<<"---Guess Hit---"<<"Part: "<<m_gapid[0]<<" Seg: "<<m_gapid[1]<<" Gap:
32 // "<<m_gapid[2]<<" Strip:
33 // "<<m_iStrip<<endl; cout<<"---Near Hit---"<<"Part: "<<m_nearesthit->Part()<<" Seg:
34 // "<<m_nearesthit->Seg()<<" Gap: "<<m_nearesthit->Gap()<<" Strip:
35 // "<<m_nearesthit->Strip()<<endl;
36 Hep3Vector mom_unit = m_CurrentMomentum;
37 mom_unit.setMag( 1.0 );
38 Hep3Vector IntrPos_loc = m_nearesthit->GetGap()->TransformToGap( m_CurrentInsct );
39 Hep3Vector mom_loc = m_nearesthit->GetGap()->RotateToGap( m_CurrentMomentum );
40 MucGeoGap* nearestGap = m_nearesthit->GetGap();
41 // get the orient and sigma of the nearest hit
42 m_orient = nearestGap->Orient();
43 float sx, sy, sz;
44 m_nearesthit->GetStrip()->GetCenterSigma( sx, sy, sz );
45 if ( m_orient == 1 ) m_sigma = sx / sqrt( 12. );
46 if ( m_orient == 0 ) m_sigma = sy / sqrt( 12. );
47
48 HepMatrix rotation = GetRoationMatrix( nearestGap );
49 HepSymMatrix IntrErr_loc( 6, 0 );
50 IntrErr_loc.assign( rotation * m_CurrentInsctXPErr * rotation.T() );
51 Hep3Vector modpos_loc;
52 Hep3Vector modmom_loc;
53 HepSymMatrix moderr_loc( 6, 0 );
54 // fitting
55 double chisq = Fit( IntrPos_loc, mom_loc, IntrErr_loc );
56 modpos_loc.setX( m_bm[0] );
57 modpos_loc.setY( m_bm[1] );
58 modpos_loc.setZ( m_bm[2] );
59 modmom_loc.setX( m_bm[3] );
60 modmom_loc.setY( m_bm[4] );
61 modmom_loc.setZ( m_bm[5] );
62 moderr_loc = m_Ebm;
63 bool direction = false;
64 double dirchange = ( modmom_loc.theta() - 1.5707963 ) * ( mom_loc.theta() - 1.5707963 );
65 if ( dirchange < 0. )
66 {
67 direction = true; // cout<<"------direction has been changed "<<endl;//disdir++;
68 }
69
70 Hep3Vector modpos_glob = m_nearesthit->GetGap()->TransformToGlobal( modpos_loc );
71 Hep3Vector modmom_glob = m_nearesthit->GetGap()->RotateToGlobal( modmom_loc );
72 HepSymMatrix moderr_glob( 6, 0 );
73 moderr_glob.assign( rotation.T() * moderr_loc * rotation );
74
75 if ( chisq > 0. && chisq < 100. && !direction )
76 {
77 // cout<<"filter is OK "<<endl;
78 FilterOK = true;
79 Chi2_sub = chisq;
80 m_err_mod = moderr_glob;
81 m_pos_mod = modpos_glob;
82 m_mom_mod = modmom_glob;
83 }
84 return FilterOK;
85}
double Fit(Hep3Vector &pos, Hep3Vector &mom, HepSymMatrix &err)
HepMatrix GetRoationMatrix(MucGeoGap *box)

Referenced by ExtSteppingAction::UserSteppingAction().

◆ Fit()

double ExtMucKal::Fit ( Hep3Vector & pos,
Hep3Vector & mom,
HepSymMatrix & err )

Definition at line 351 of file ExtMucKal.cxx.

351 {
352 static HepVector a( 6, 0 );
353 a[0] = pos.x();
354 a[1] = pos.y();
355 a[2] = pos.z();
356 a[3] = mom.x(); // protect from NaN
357 a[4] = mom.y();
358 a[5] = mom.z();
359 m_bm = a;
360 m_Ebm = Epm;
361
362 HepMatrix V_meas( 1, 1, 0 );
363 V_meas( 1, 1 ) = m_sigma * m_sigma;
364 double mag2( m_bm[5] * m_bm[5] + m_bm[4] * m_bm[4] + m_bm[3] * m_bm[3] );
365 // static HepSymMatrix ebm(6,0);
366 HepSymMatrix ebm( 6, 0 );
367 ebm.assign( m_Ebm );
368 // static HepVector v_bm(6,0);
369 HepVector v_bm( 6, 0 );
370 // v_bm[2] = bm()[2];//because bm0 is never modified!
371 v_bm = m_bm;
372 v_bm[2] = 0;
373 // static HepMatrix H(1,6,0);
374 HepMatrix H( 1, 6, 0 );
375 if ( m_orient == 1 )
376 H( 1, 1 ) = 1; //;if(part==1&&gap==0)ebm(1,1)=ebm(1,1)*1.6;}// H[1][1] = 1;
377 if ( m_orient == 0 )
378 H( 1, 2 ) = 1; //;if(part==1&&gap==1)ebm(2,2)=ebm(2,2)*2.4;}//H[1][2] = 1;
379 HepMatrix ebm_HT( 6, 1, 0 );
380 ebm_HT = ebm * H.T();
381
382 HepMatrix R( 1, 1, 0 );
383
384 HepMatrix R2( 1, 1, 0 );
385 HepMatrix Aii( 1, 1, 0 );
386 Aii( 1, 1 ) = ( H * ebm_HT )( 1, 1 );
387 R = H * ebm_HT + V_meas;
388 // double r = (H * ebm_HT)(1,1);
389 R2 = Aii + V_meas;
390 double aii = Aii( 1, 1 );
391 // static HepMatrix K(6,1,0);
392 HepMatrix K( 6, 1, 0 );
393 int ierr;
394 K = ebm_HT * R.inverse( ierr ); // Kalman gain matrix
395 double dist = GetDistance( m_nearesthit );
396 double r = R2( 1, 1 );
397 double pull;
398 if ( r == 0. ) pull = 9999;
399 else pull = dist / sqrt( r );
400 m_pull = pull;
401 // cout<<"in filter distance between hit and track is "<<dist<<endl;
402 // static HepVector diff_v_bm(6, 0);
403 HepVector diff_v_bm( 6, 0 );
404 diff_v_bm = K * dist;
405
406 //// check diff_v_bm! sometime huge diff_v_bm make serious SEGV.
407 // So, if diff is more than 2 time of window,discard it.
408 if ( ( fabs( diff_v_bm[0] ) > 2 * n_sigm * sqrt( V_meas( 1, 1 ) + fabs( m_Ebm( 1, 1 ) ) ) &&
409 m_orient == 1 ) ||
410 ( fabs( diff_v_bm[1] ) > 2 * n_sigm * sqrt( V_meas( 1, 1 ) + fabs( m_Ebm( 2, 2 ) ) ) &&
411 m_orient == 0 ) )
412 {
413 // #ifdef DEBUG
414 cout << "KLMK:WARNING! Huge diff_v_bm found!Discard this fit!: " << endl;
415 return 99999;
416 } ////////////////////////////////////
417
418 HepVector v_bm_mod = v_bm + diff_v_bm;
419
420 static const HepSymMatrix Id( 6, 1 );
421 HepMatrix ebm_mod( 6, 6, 0 );
422 ebm_mod = ( Id - K * H ) * ebm;
423 double r_bm;
424 r_bm = ( 1 - ( H * K )( 1, 1 ) ) * dist;
425 // static HepMatrix Rk(2,2);
426 double Rk;
427 Rk = ( V_meas - H * ebm_mod * H.T() )( 1, 1 );
428 double chi2;
429 if ( Rk == 0. ) chi2 = 99999;
430 else chi2 = pull * pull;
431 m_pull = pull;
432 if ( chi2 > 0 && chi2 < chi2lim_ )
433 {
434 HepSymMatrix ebm_replace;
435 ebm_replace.assign( ebm_mod );
436 HepVector v_bm_replace;
437 v_bm_replace = v_bm_mod;
438 v_bm_replace[2] = 0;
439 m_bm = v_bm_replace;
440 m_Ebm = ebm_replace;
441 if ( fix_ )
442 {
443 double mag2mod( m_bm[5] * m_bm[5] + m_bm[4] * m_bm[4] + m_bm[3] * m_bm[3] );
444 v_bm_replace[3] = v_bm_replace[3] * sqrt( mag2 ) / sqrt( mag2mod );
445 v_bm_replace[4] = v_bm_replace[4] * sqrt( mag2 ) / sqrt( mag2mod );
446 v_bm_replace[5] = v_bm_replace[5] * sqrt( mag2 ) / sqrt( mag2mod );
447 m_bm = v_bm_replace;
448 }
449
450 // Keep magnitude of momentum
451 // double bm52(mag2/(1+(bm()[3]*bm()[3]+bm()[4]*bm()[4]))
452 // *(1+bm()[3]*bm()[3]));
453 // v_bm_replace[5] = sqrt(bm52);
454 // if (fix_) bm(v_bm_replace); //I can't confirm if it is needed or not.
455 }
456
457 // cout<<" in filter chisq is "<<chiSq<<endl;
458 return chi2;
459}
double GetDistance(const MucRecHit *hit)
IMPLICIT REAL *A H
Definition myXsection.h:1
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)
Definition TUtil.h:22

Referenced by ExtMucFilter().

◆ GapHit()

vector< MucRecHit * > ExtMucKal::GapHit ( )

Definition at line 219 of file ExtMucKal.cxx.

219 {
220 vector<MucRecHit*> gaphit;
221 int kDeltaSeg[3] = { -1, 0, 1 };
222 MucDigiCol::iterator digiIter = m_MucDigiCol->begin();
223 for ( ; digiIter != m_MucDigiCol->end(); digiIter++ )
224 {
225 Identifier mucId = ( *digiIter )->identify();
226 int part = MucID::barrel_ec( mucId );
227 int segment = MucID::segment( mucId );
228 int layer = MucID::layer( mucId );
229 int strip = MucID::strip( mucId );
230 int m_part = (int)m_gapid[0];
231 int m_seg = (int)m_gapid[1];
232 int m_gap = (int)m_gapid[2];
233
234 // if(part==0 && segment ==2 && layer ==6 && strip ==60)continue;
235 if ( m_part == part && m_gap == layer )
236 for ( int s = 0; s < 3; s++ )
237 {
238 int iSeg = m_seg + kDeltaSeg[s];
239 if ( iSeg < 0 ) iSeg += MucID::getSegNum( m_part );
240 if ( iSeg > ( (int)MucID::getSegNum( m_part ) - 1 ) )
241 iSeg -= MucID::getSegNum( m_part );
242 if ( iSeg == segment )
243 {
244 MucRecHit* hit = new MucRecHit( part, segment, layer, strip );
245 gaphit.push_back( hit );
246 }
247 }
248 }
249 return gaphit;
250}
XmlRpcServer s
const int kDeltaSeg[kNSegSearch]
static int barrel_ec(const Identifier &id)
Values of different levels.
Definition MucID.cxx:38
static int layer(const Identifier &id)
Definition MucID.cxx:58
static int segment(const Identifier &id)
Definition MucID.cxx:48
static value_type getSegNum(int part)
Definition MucID.cxx:134
static int strip(const Identifier &id)
Definition MucID.cxx:73

Referenced by TrackHit().

◆ GetChi2()

double ExtMucKal::GetChi2 ( )
inline

Definition at line 37 of file ExtMucKal.h.

37{ return Chi2_sub; }

Referenced by ExtSteppingAction::UserSteppingAction().

◆ GetDistance()

double ExtMucKal::GetDistance ( const MucRecHit * hit)

Definition at line 142 of file ExtMucKal.cxx.

142 {
143 if ( !hit )
144 {
145 cout << "RecMucTrack:GetHitDistance-E1 null hit pointer!" << endl;
146 return kInfinity;
147 }
148
149 int part = hit->Part();
150 int gap = hit->Gap();
151 if ( ( gap < 0 ) || ( gap >= (int)MucID::getGapNum( part ) ) )
152 {
153 cout << "RecMucTrack::GetHitDistance() bad gap number = " << gap << endl;
154 return kInfinity;
155 }
156 HepPoint3D posHit = hit->GetCenterPos();
157 HepPoint3D posHitLocal = hit->GetGap()->TransformToGap( posHit );
158 HepPoint3D posInsctLocal = hit->GetGap()->TransformToGap( m_CurrentInsct );
159 int orient = hit->GetGap()->Orient();
160
161 float distance = -9990;
162 if ( orient == 1 ) distance = ( posHitLocal.x() - posInsctLocal.x() );
163 if ( orient == 0 ) distance = ( posHitLocal.y() - posInsctLocal.y() );
164 // cout<<"gap hit pos: "<<"x: "<<posHitLocal.x()<<" y: "<<posHitLocal.y()<<" z:
165 // "<<posHitLocal.z()<<endl;
166 return distance;
167}
HepGeom::Point3D< double > HepPoint3D
HepPoint3D TransformToGap(const HepPoint3D gPoint) const
Transform a point from global coordinate to gap coordinate.
static value_type getGapNum(int part)
Definition MucID.cxx:141
MucGeoGap * GetGap() const
Get geometry data for the gap containing this hit.
Hep3Vector GetCenterPos() const
Get Center position of the strip (global coords).
Definition MucRecHit.cxx:93

Referenced by Fit(), and TrackHit().

◆ GetFilterStatus()

bool ExtMucKal::GetFilterStatus ( )
inline

Definition at line 36 of file ExtMucKal.h.

36{ return FilterOK; }

◆ GetHitGap()

Hep3Vector ExtMucKal::GetHitGap ( )

Definition at line 252 of file ExtMucKal.cxx.

252 {
253 m_hitgap.setX( m_nearesthit->Part() );
254 m_hitgap.setY( m_nearesthit->Seg() );
255 m_hitgap.setZ( m_nearesthit->Gap() );
256 return m_hitgap;
257}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ GetOrient()

int ExtMucKal::GetOrient ( )
inline

Definition at line 40 of file ExtMucKal.h.

40{ return m_orient; }

◆ GetPull()

double ExtMucKal::GetPull ( )
inline

Definition at line 39 of file ExtMucKal.h.

39{ return m_pull; }

◆ GetRoationMatrix()

HepMatrix ExtMucKal::GetRoationMatrix ( MucGeoGap * box)

Definition at line 309 of file ExtMucKal.cxx.

310{
311
312 // cout<<"now in ExtMucKalTransfor::GetRoationMatrix() "<<endl;
313 MucGeoGap* box_ = box;
314 float thetaX, phiX, thetaY, phiY, thetaZ, phiZ;
315 box->GetRotationMatrix( thetaX, phiX, thetaY, phiY, thetaZ, phiZ );
316 // cout<<"after get m_box->GetRotationMatrix "<<endl;
317 thetaX = thetaX / kRad;
318 thetaY = thetaY / kRad;
319 thetaZ = thetaZ / kRad;
320 phiX = phiX / kRad;
321 phiY = phiY / kRad;
322 phiZ = phiZ / kRad;
323 Hep3Vector colX, colY, colZ;
324 colX.setRThetaPhi( 1., thetaX, phiX );
325 colY.setRThetaPhi( 1., thetaY, phiY );
326 colZ.setRThetaPhi( 1., thetaZ, phiZ );
327 // cout<<"will give value to rotation "<<endl;
328 HepMatrix rotation( 6, 6, 0 );
329 rotation( 1, 1 ) = colX.x();
330 rotation( 1, 2 ) = colX.y();
331 rotation( 1, 3 ) = colX.z();
332 rotation( 2, 1 ) = colY.x();
333 rotation( 2, 2 ) = colY.y();
334 rotation( 2, 3 ) = colY.z();
335 rotation( 3, 1 ) = colZ.x();
336 rotation( 3, 2 ) = colZ.y();
337 rotation( 3, 3 ) = colZ.z();
338
339 rotation( 4, 4 ) = colX.x();
340 rotation( 4, 5 ) = colX.y();
341 rotation( 4, 6 ) = colX.z();
342 rotation( 5, 4 ) = colY.x();
343 rotation( 5, 5 ) = colY.y();
344 rotation( 5, 6 ) = colY.z();
345 rotation( 6, 4 ) = colZ.x();
346 rotation( 6, 5 ) = colZ.y();
347 rotation( 6, 6 ) = colZ.z();
348 return rotation;
349}
const Double_t kRad
Definition BesTView.cxx:34
void GetRotationMatrix(float &thetaX, float &phiX, float &thetaY, float &phiY, float &thetaZ, float &phiZ) const
Get the rotation angles (in degrees) of the gap in global coordinate.

Referenced by ExtMucFilter(), and TrackHit().

◆ GetSameStrip()

bool ExtMucKal::GetSameStrip ( )
inline

Definition at line 44 of file ExtMucKal.h.

44{ return m_samestrip; }

Referenced by ExtSteppingAction::UserSteppingAction().

◆ JCB()

bool ExtMucKal::JCB ( )

Definition at line 259 of file ExtMucKal.cxx.

259 {
260 HepMatrix m_xp_jcb( 6, 6, 0 );
261 double dx( ( m_CurrentInsct - m_CurrentPosition ).mag() );
262 double dp( 0. ); // dp( ( pv1 - m_pv ).mag() );
263 double p2( m_CurrentMomentum.mag2() );
264 double p_abs( sqrt( p2 ) );
265
266 double p_inv;
267 if ( p_abs > Small && m_CurrentMomentum.mag() > Small ) { p_inv = 1.0 / p_abs; }
268 else
269 {
270 p_inv = Infinite;
271 return 0;
272 }
273 double p2inv( p_inv * p_inv );
274 double p3inv( p2inv * p_inv );
275 double fdx( dx * p3inv );
276
277 double fdp( dp * p_inv );
278 double px( m_CurrentMomentum.x() );
279 double py( m_CurrentMomentum.y() );
280 double pz( m_CurrentMomentum.z() );
281 double px2( px * px );
282 double py2( py * py );
283 double pz2( pz * pz );
284 double pxy( px * py );
285 double pyz( py * pz );
286 double pzx( pz * px );
287 m_xp_jcb( 1, 1 ) = 1.0; // dx'/dx
288 m_xp_jcb( 1, 4 ) = fdx * ( py2 + pz2 ); // dx'/dpx
289 m_xp_jcb( 1, 5 ) = -fdx * pxy; // dx'/dpy
290 m_xp_jcb( 1, 6 ) = -fdx * pzx; // dx'/dpz
291 m_xp_jcb( 2, 2 ) = 1.0; // dy'/dy
292 m_xp_jcb( 2, 4 ) = -fdx * pxy; // dy'/dpx
293 m_xp_jcb( 2, 5 ) = fdx * ( pz2 + px2 ); // dy'/dpy
294 m_xp_jcb( 2, 6 ) = -fdx * pyz; // dy'/dpz
295
296 m_xp_jcb( 3, 3 ) = 1.0; // dz'/dz
297 m_xp_jcb( 3, 4 ) = -fdx * pzx; // dz'/dpx
298 m_xp_jcb( 3, 5 ) = -fdx * pyz; // dz'/dpy
299 m_xp_jcb( 3, 6 ) = fdx * ( px2 + py2 ); // dz'/dpz
300
301 m_xp_jcb( 4, 4 ) = 1.0 - fdp; // dx'/dx energy loss
302 m_xp_jcb( 5, 5 ) = 1.0 - fdp; // dy'/dy energy loss
303 m_xp_jcb( 6, 6 ) = 1.0 - fdp; // dz'/dz energy loss
304 m_jcb = m_xp_jcb;
305 return 1;
306 // m_CurrentInsctXPErr = m_CurrentInsct.similarity( m_xp_jcb );
307}
double p2[4]

Referenced by MucKalIniti().

◆ MucKalIniti()

bool ExtMucKal::MucKalIniti ( )

Definition at line 169 of file ExtMucKal.cxx.

171{
172 MucGeoGap* box =
173 MucGeoGeneral::Instance()->GetGap( (int)m_gapid[0], (int)m_gapid[1], (int)m_gapid[2] );
174 Hep3Vector mom_unit = m_CurrentMomentum;
175 mom_unit.setMag( 1.0 );
176 HepVector3D _interc = box->ProjectToGap( m_CurrentPosition, mom_unit );
177 m_CurrentInsct = _interc;
178 HepVector3D m_CurrentInsct_loc = box->TransformToGap( m_CurrentInsct );
179 int iStrip = box->GuessStrip( m_CurrentInsct_loc.x(), m_CurrentInsct_loc.y(),
180 m_CurrentInsct_loc.z() );
181 m_iStrip = iStrip;
182 // Tuning-------------
183 /*
184 cout<<"----------------------------------------------------"<<endl;
185 cout<<"Insct pos_loc: "<<"x: "<<m_CurrentInsct_loc.x()<<" y:"<<m_CurrentInsct_loc.y()<<"
186 z:"<<m_CurrentInsct_loc.z()<<endl; cout<<"---Guess Hit---"<<"Part: "<<m_gapid[0]<<" Seg:
187 "<<m_gapid[1]<<" Gap:
188 "<<m_gapid[2]<<" Strip: "<<m_iStrip<<endl; int stripMax = box->GetStripNum()-1; if(iStrip <
189 stripMax&&iStrip>0 )
190 {
191 MucRecHit guess_hit(m_gapid[0],m_gapid[1],m_gapid[2],m_iStrip);
192 HepPoint3D posHit = guess_hit.GetCenterPos();
193 HepPoint3D posHit_loc = box->TransformToGap(posHit);
194 cout<<"Guess Hit Pos--- "<<"x: "<<posHit_loc.x()<<" y: "<<posHit_loc.y()<<" z:
195 "<<posHit_loc.z()<<endl;
196 }
197 */
198 // Tuning--------------
199 bool iniOK = false;
200 iniOK = JCB();
201 m_CurrentInsctXPErr = m_CurrentXPErr.similarity( m_jcb );
202 return iniOK;
203}
HepGeom::Vector3D< double > HepVector3D
bool JCB()
int GuessStrip(const float x, const float y, const float z) const
HepPoint3D ProjectToGap(const HepPoint3D gPoint, const Hep3Vector gVect) const
Given a line, find the intersection with the gap in the global.
MucGeoGap * GetGap(const int part, const int seg, const int gap) const
Get a pointer to the gap identified by (part,seg,gap).
static MucGeoGeneral * Instance()
Get a pointer to the single instance of MucGeoGeneral.

Referenced by ExtSteppingAction::UserSteppingAction().

◆ SetGapID()

void ExtMucKal::SetGapID ( Hep3Vector id)
inline

Definition at line 30 of file ExtMucKal.h.

30{ m_gapid = id; }

Referenced by ExtSteppingAction::UserSteppingAction().

◆ SetMucDigiCol()

void ExtMucKal::SetMucDigiCol ( MucDigiCol * amucdigi)
inline

Definition at line 28 of file ExtMucKal.h.

28{ m_MucDigiCol = amucdigi; }

Referenced by ExtSteppingAction::UserSteppingAction().

◆ SetMucWindow()

void ExtMucKal::SetMucWindow ( int aMucWindow)
inline

Definition at line 29 of file ExtMucKal.h.

29{ n_sigm = aMucWindow; }

Referenced by ExtSteppingAction::UserSteppingAction().

◆ SetPosMomErr()

void ExtMucKal::SetPosMomErr ( Hep3Vector pos,
Hep3Vector mom,
HepSymMatrix err )
inline

Definition at line 23 of file ExtMucKal.h.

23 {
24 m_CurrentPosition = pos;
25 m_CurrentMomentum = mom;
26 m_CurrentXPErr = err;
27 }

Referenced by ExtSteppingAction::UserSteppingAction().

◆ TrackHit()

vector< MucRecHit * > ExtMucKal::TrackHit ( )

Definition at line 93 of file ExtMucKal.cxx.

93 {
94 vector<MucRecHit*> hitvec;
95 vector<MucRecHit*> HitInGap = GapHit();
96 int hitsize = HitInGap.size();
97 double dist_nearest = 9999.;
98 for ( int h = 0; h < hitsize; h++ )
99 {
100
101 MucRecHit* myhit = HitInGap[h];
102 // cout<<"Gap Hit: "<<"part: "<<myhit->Part()<<" seg: "<<myhit->Seg()<<" layer:
103 // "<<myhit->Gap()<<" strip:
104 // "<<myhit->Strip()<<endl;
105 MucGeoGap* mygap = myhit->GetGap();
106 HepMatrix rotation = GetRoationMatrix( mygap );
107 HepSymMatrix IntrErr_loc( 6, 0 );
108 IntrErr_loc.assign( rotation * m_CurrentInsctXPErr * rotation.T() );
109 float sx, sy, sz;
110 myhit->GetStrip()->GetCenterSigma( sx, sy, sz );
111 double distance = GetDistance( myhit );
112 double window = -9999.;
113 int myorient = myhit->GetGap()->Orient();
114 if ( myorient == 1 ) // strip parallel y axis
115 window = n_sigm * sqrt( IntrErr_loc( 1, 1 ) + sx * sx / 12. );
116 // window = 4.*sx;
117 //{window = n_sigm*sqrt(IntrErr_loc(1,1)+sx*sx/12.);cout<<"sx: "<<sx<<endl;cout<<"window:
118 //"<<window<<endl;cout<<"window/strip: "<<floor(window/sx)<<endl;}
119 if ( myorient == 0 ) window = n_sigm * sqrt( IntrErr_loc( 2, 2 ) + sy * sy / 12. );
120 // window = 4.*sy;
121 //{window = n_sigm*sqrt(IntrErr_loc(2,2)+sy*sy/12.);cout<<"sy: "<<sy<<endl;cout<<"window:
122 //"<<window<<endl;cout<<"window/strip: "<<floor(window/sy)<<endl;}
123
124 // cout<<"window/strip: "<<floor(window/sx)<<endl;
125 // cout<<"distance: "<<distance<<endl;
126 if ( fabs( distance ) < window )
127 {
128 hitvec.push_back( myhit );
129 if ( dist_nearest > fabs( distance ) )
130 {
131 // cout<<"Hit exist"<<endl;
132 HitExist = true;
133 dist_nearest = fabs( distance );
134 m_nearesthit = HitInGap[h];
135 }
136 }
137 }
138
139 return hitvec;
140}
vector< MucRecHit * > GapHit()
void GetCenterSigma(float &sx, float &sy, float &sz)
Get uncertainty in the position of this strip (in the gap coordinate system).
MucGeoStrip * GetStrip() const
Get geometry data for the strip containing this hit.

Referenced by ExtSteppingAction::UserSteppingAction().

◆ XPmod()

void ExtMucKal::XPmod ( Hep3Vector & pos,
Hep3Vector & mom,
HepSymMatrix & err )

Definition at line 87 of file ExtMucKal.cxx.

87 {
88 pos = m_pos_mod;
89 mom = m_mom_mod;
90 err = m_err_mod;
91}

Referenced by ExtSteppingAction::UserSteppingAction().


The documentation for this class was generated from the following files: