CGEM BOSS 6.6.5.i
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 17 of file ExtMucKal.h.

Constructor & Destructor Documentation

◆ ExtMucKal()

ExtMucKal::ExtMucKal ( )

Definition at line 10 of file ExtMucKal.cxx.

10 :FilterOK(false),Chi2_sub(-1),HitExist(false),m_jcb(6,6,0),m_samestrip(false),n_sigm(6)
11{;}

◆ ~ExtMucKal()

ExtMucKal::~ExtMucKal ( )

Definition at line 13 of file ExtMucKal.cxx.

14{;}

Member Function Documentation

◆ ExtMucFilter()

bool ExtMucKal::ExtMucFilter ( )

Definition at line 16 of file ExtMucKal.cxx.

17{
18
19 if(!HitExist) {FilterOK = false;return FilterOK;}
20 m_samestrip = m_gapid[0]==m_nearesthit->Part()&& m_gapid[1]==m_nearesthit->Seg()&&m_gapid[2]==m_nearesthit->Gap()&&m_iStrip==m_nearesthit->Strip();
21// cout<<"---Guess Hit---"<<"Part: "<<m_gapid[0]<<" Seg: "<<m_gapid[1]<<" Gap: "<<m_gapid[2]<<" Strip: "<<m_iStrip<<endl;
22// cout<<"---Near Hit---"<<"Part: "<<m_nearesthit->Part()<<" Seg: "<<m_nearesthit->Seg()<<" Gap: "<<m_nearesthit->Gap()<<" Strip: "<<m_nearesthit->Strip()<<endl;
23 Hep3Vector mom_unit = m_CurrentMomentum;
24 mom_unit.setMag(1.0);
25 Hep3Vector IntrPos_loc = m_nearesthit->GetGap()->TransformToGap(m_CurrentInsct);
26 Hep3Vector mom_loc = m_nearesthit->GetGap()->RotateToGap(m_CurrentMomentum);
27 MucGeoGap* nearestGap = m_nearesthit->GetGap();
28 //get the orient and sigma of the nearest hit
29 m_orient = nearestGap->Orient();
30 float sx,sy,sz;
31 m_nearesthit->GetStrip()->GetCenterSigma(sx, sy, sz);
32 if(m_orient==1) m_sigma = sx/sqrt(12.);
33 if(m_orient==0) m_sigma = sy/sqrt(12.);
34
35 HepMatrix rotation = GetRoationMatrix(nearestGap);
36 HepSymMatrix IntrErr_loc(6,0);
37 IntrErr_loc.assign(rotation*m_CurrentInsctXPErr*rotation.T());
38 Hep3Vector modpos_loc;
39 Hep3Vector modmom_loc;
40 HepSymMatrix moderr_loc(6,0);
41 //fitting
42 double chisq =Fit(IntrPos_loc,mom_loc,IntrErr_loc);
43 modpos_loc.setX(m_bm[0]);modpos_loc.setY(m_bm[1]);modpos_loc.setZ(m_bm[2]);
44 modmom_loc.setX(m_bm[3]);modmom_loc.setY(m_bm[4]);modmom_loc.setZ(m_bm[5]);
45 moderr_loc = m_Ebm;
46bool direction = false;
47double dirchange = (modmom_loc.theta()-1.5707963)*(mom_loc.theta()-1.5707963);
48if(dirchange<0.) {direction = true; //cout<<"------direction has been changed "<<endl;//disdir++;
49}
50
51Hep3Vector modpos_glob = m_nearesthit->GetGap()->TransformToGlobal(modpos_loc);
52Hep3Vector modmom_glob = m_nearesthit->GetGap()->RotateToGlobal(modmom_loc);
53HepSymMatrix moderr_glob(6,0);
54moderr_glob.assign(rotation.T()*moderr_loc*rotation);
55
56if(chisq>0.&&chisq<100.&&!direction)
57{
58 //cout<<"filter is OK "<<endl;
59 FilterOK=true;
60 Chi2_sub = chisq;
61 m_err_mod = moderr_glob;
62 m_pos_mod = modpos_glob;
63 m_mom_mod = modmom_glob;
64
65}
66return FilterOK;
67}
double Fit(Hep3Vector &pos, Hep3Vector &mom, HepSymMatrix &err)
HepMatrix GetRoationMatrix(MucGeoGap *box)
Hep3Vector RotateToGlobal(const Hep3Vector pVect) const
Rotate a vector from gap coordinate to global coordinate.
Hep3Vector RotateToGap(const Hep3Vector gVect) const
Rotate a vector from global coordinate to gap coordinate.
HepPoint3D TransformToGlobal(const HepPoint3D pPoint) const
Transform a point from gap coordinate to global coordinate.
HepPoint3D TransformToGap(const HepPoint3D gPoint) const
Transform a point from global coordinate to gap coordinate.
int Orient() const
Definition MucGeoGap.h:108
void GetCenterSigma(float &sx, float &sy, float &sz)
Get uncertainty in the position of this strip (in the gap coordinate system).
int Seg() const
Get Seg.
Definition MucRecHit.h:74
MucGeoGap * GetGap() const
Get geometry data for the gap containing this hit.
Definition MucRecHit.h:83
MucGeoStrip * GetStrip() const
Get geometry data for the strip containing this hit.
Definition MucRecHit.h:86
int Part() const
Get Part.
Definition MucRecHit.h:71
int Gap() const
Get Gap.
Definition MucRecHit.h:77
int Strip() const
Get Strip.
Definition MucRecHit.h:80

Referenced by ExtSteppingAction::UserSteppingAction().

◆ Fit()

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

Definition at line 331 of file ExtMucKal.cxx.

332{
333 static HepVector a(6,0);
334 a[0] = pos.x();
335 a[1] = pos.y();
336 a[2] = pos.z();
337 a[3] = mom.x();//protect from NaN
338 a[4] = mom.y();
339 a[5] = mom.z();
340 m_bm = a;
341 m_Ebm = Epm;
342
343 HepMatrix V_meas(1,1,0);
344 V_meas(1,1)= m_sigma*m_sigma;
345 double mag2(m_bm[5]*m_bm[5]+m_bm[4]*m_bm[4]+m_bm[3]*m_bm[3]);
346 //static HepSymMatrix ebm(6,0);
347 HepSymMatrix ebm(6,0);
348 ebm.assign(m_Ebm);
349 //static HepVector v_bm(6,0);
350 HepVector v_bm(6,0);
351 //v_bm[2] = bm()[2];//because bm0 is never modified!
352 v_bm = m_bm;
353 v_bm[2] = 0;
354 //static HepMatrix H(1,6,0);
355 HepMatrix H(1,6,0);
356 if(m_orient == 1) H(1,1) = 1;//;if(part==1&&gap==0)ebm(1,1)=ebm(1,1)*1.6;}// H[1][1] = 1;
357 if(m_orient == 0) H(1,2) = 1;//;if(part==1&&gap==1)ebm(2,2)=ebm(2,2)*2.4;}//H[1][2] = 1;
358 HepMatrix ebm_HT(6,1,0);
359 ebm_HT = ebm * H.T();
360
361 HepMatrix R(1,1,0);
362
363 HepMatrix R2(1,1,0);
364 HepMatrix Aii(1,1,0);
365 Aii(1,1)=(H * ebm_HT)(1,1);
366 R = H * ebm_HT + V_meas;
367 //double r = (H * ebm_HT)(1,1);
368 R2 = Aii + V_meas;
369 double aii = Aii(1,1);
370 //static HepMatrix K(6,1,0);
371 HepMatrix K(6,1,0);
372 int ierr;
373 K = ebm_HT * R.inverse(ierr);//Kalman gain matrix
374 double dist = GetDistance(m_nearesthit);
375 double r = R2(1,1);
376 double pull;
377 if(r==0.)pull = 9999;
378 else
379 pull = dist/sqrt(r);
380 m_pull = pull;
381// cout<<"in filter distance between hit and track is "<<dist<<endl;
382 //static HepVector diff_v_bm(6, 0);
383 HepVector diff_v_bm(6, 0);
384 diff_v_bm = K * dist;
385
386 //// check diff_v_bm! sometime huge diff_v_bm make serious SEGV.
387 // So, if diff is more than 2 time of window,discard it.
388 if ((fabs(diff_v_bm[0]) > 2 * n_sigm * sqrt(V_meas(1,1)+fabs(m_Ebm(1,1)))&&m_orient==1) ||
389 (fabs(diff_v_bm[1]) > 2 * n_sigm * sqrt(V_meas(1,1)+fabs(m_Ebm(2,2)))&&m_orient==0) ){
390//#ifdef DEBUG
391 cout<<"KLMK:WARNING! Huge diff_v_bm found!Discard this fit!: "<<endl;
392 return 99999;
393 }////////////////////////////////////
394
395 HepVector v_bm_mod = v_bm + diff_v_bm;
396
397 static const HepSymMatrix Id(6,1);
398 HepMatrix ebm_mod(6,6,0);
399 ebm_mod = (Id - K*H) * ebm;
400 double r_bm;
401 r_bm = (1 - (H*K)(1,1))*dist;
402 //static HepMatrix Rk(2,2);
403 double Rk;
404 Rk = (V_meas - H * ebm_mod * H.T())(1,1);
405 double chi2;
406 if(Rk==0.)
407 chi2 = 99999;
408 else
409 chi2 = pull*pull;
410 m_pull = pull;
411 if (chi2>0 && chi2 < chi2lim_) {
412 HepSymMatrix ebm_replace;
413 ebm_replace.assign(ebm_mod);
414 HepVector v_bm_replace;
415 v_bm_replace = v_bm_mod;
416 v_bm_replace[2] = 0;
417 m_bm = v_bm_replace;
418 m_Ebm= ebm_replace;
419 if(fix_)
420 {
421 double mag2mod(m_bm[5]*m_bm[5]+m_bm[4]*m_bm[4]+m_bm[3]*m_bm[3]);
422 v_bm_replace[3] = v_bm_replace[3]*sqrt(mag2)/sqrt(mag2mod);
423 v_bm_replace[4] = v_bm_replace[4]*sqrt(mag2)/sqrt(mag2mod);
424 v_bm_replace[5] = v_bm_replace[5]*sqrt(mag2)/sqrt(mag2mod);
425 m_bm=v_bm_replace;
426 }
427
428 // Keep magnitude of momentum
429 //double bm52(mag2/(1+(bm()[3]*bm()[3]+bm()[4]*bm()[4]))
430 // *(1+bm()[3]*bm()[3]));
431 //v_bm_replace[5] = sqrt(bm52);
432 //if (fix_) bm(v_bm_replace); //I can't confirm if it is needed or not.
433 }
434
435 // cout<<" in filter chisq is "<<chiSq<<endl;
436 return chi2;
437}
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:27

Referenced by ExtMucFilter().

◆ GapHit()

vector< MucRecHit * > ExtMucKal::GapHit ( )

Definition at line 195 of file ExtMucKal.cxx.

196{
197 vector<MucRecHit*> gaphit;
198 int kDeltaSeg[3]={-1,0,1};
199 MucDigiCol::iterator digiIter = m_MucDigiCol->begin();
200 for ( ; digiIter != m_MucDigiCol->end(); digiIter++ )
201 {
202 Identifier mucId = (*digiIter)->identify();
203 int part = MucID::barrel_ec(mucId);
204 int segment = MucID::segment(mucId);
205 int layer = MucID::layer(mucId);
206 int strip = MucID::strip(mucId);
207 int m_part =(int)m_gapid[0];
208 int m_seg = (int)m_gapid[1];
209 int m_gap = (int)m_gapid[2];
210
211 //if(part==0 && segment ==2 && layer ==6 && strip ==60)continue;
212 if(m_part==part&&m_gap == layer)
213 for(int s=0;s<3;s++)
214 {
215 int iSeg = m_seg+kDeltaSeg[s];
216 if(iSeg<0) iSeg += MucID::getSegNum(m_part);
217 if(iSeg>((int)MucID::getSegNum(m_part) - 1))iSeg -= MucID::getSegNum(m_part);
218 if(iSeg==segment)
219 {
220 MucRecHit* hit = new MucRecHit(part,segment,layer,strip);
221 gaphit.push_back(hit);
222 }
223 }
224 }
225 return gaphit;
226}
XmlRpcServer s
const int kDeltaSeg[kNSegSearch]
static int barrel_ec(const Identifier &id)
Values of different levels.
Definition MucID.cxx:41
static int layer(const Identifier &id)
Definition MucID.cxx:61
static int segment(const Identifier &id)
Definition MucID.cxx:51
static value_type getSegNum(int part)
Definition MucID.cxx:164
static int strip(const Identifier &id)
Definition MucID.cxx:76

Referenced by TrackHit().

◆ GetChi2()

double ExtMucKal::GetChi2 ( )
inline

Definition at line 35 of file ExtMucKal.h.

35{return Chi2_sub;}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ GetDistance()

double ExtMucKal::GetDistance ( const MucRecHit * hit)

Definition at line 125 of file ExtMucKal.cxx.

126{
127 if (!hit) {
128 cout << "RecMucTrack:GetHitDistance-E1 null hit pointer!" << endl;
129 return kInfinity;
130 }
131
132 int part = hit->Part();
133 int gap = hit->Gap();
134 if ( (gap < 0) || (gap >= (int)MucID::getGapNum(part)) ) {
135 cout << "RecMucTrack::GetHitDistance() bad gap number = " << gap << endl;
136 return kInfinity;
137 }
138 HepPoint3D posHit = hit->GetCenterPos();
139 HepPoint3D posHitLocal = hit->GetGap()->TransformToGap(posHit);
140 HepPoint3D posInsctLocal = hit->GetGap()->TransformToGap(m_CurrentInsct);
141 int orient = hit->GetGap()->Orient();
142
143 float distance = -9990;
144 if(orient == 1) distance = (posHitLocal.x()-posInsctLocal.x());
145 if(orient == 0) distance = (posHitLocal.y()-posInsctLocal.y());
146 //cout<<"gap hit pos: "<<"x: "<<posHitLocal.x()<<" y: "<<posHitLocal.y()<<" z: "<<posHitLocal.z()<<endl;
147 return distance;
148}
static value_type getGapNum(int part)
Definition MucID.cxx:171
Hep3Vector GetCenterPos() const
Get Center position of the strip (global coords).

Referenced by Fit(), and TrackHit().

◆ GetFilterStatus()

bool ExtMucKal::GetFilterStatus ( )
inline

Definition at line 34 of file ExtMucKal.h.

34{return FilterOK;}

◆ GetHitGap()

Hep3Vector ExtMucKal::GetHitGap ( )

Definition at line 228 of file ExtMucKal.cxx.

229{
230m_hitgap.setX(m_nearesthit->Part());
231m_hitgap.setY(m_nearesthit->Seg());
232m_hitgap.setZ(m_nearesthit->Gap());
233return m_hitgap;
234}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ GetOrient()

int ExtMucKal::GetOrient ( )
inline

Definition at line 38 of file ExtMucKal.h.

38{return m_orient;}

◆ GetPull()

double ExtMucKal::GetPull ( )
inline

Definition at line 37 of file ExtMucKal.h.

37{return m_pull;}

◆ GetRoationMatrix()

HepMatrix ExtMucKal::GetRoationMatrix ( MucGeoGap * box)

Definition at line 288 of file ExtMucKal.cxx.

289{
290
291 //cout<<"now in ExtMucKalTransfor::GetRoationMatrix() "<<endl;
292 MucGeoGap* box_ = box;
293 float thetaX,phiX,thetaY,phiY,thetaZ,phiZ;
294 box->GetRotationMatrix(thetaX,phiX,thetaY,phiY,thetaZ,phiZ);
295 //cout<<"after get m_box->GetRotationMatrix "<<endl;
296 thetaX=thetaX/kRad;
297 thetaY=thetaY/kRad;
298 thetaZ=thetaZ/kRad;
299 phiX=phiX/kRad;
300 phiY=phiY/kRad;
301 phiZ=phiZ/kRad;
302 Hep3Vector colX, colY,colZ;
303 colX.setRThetaPhi(1.,thetaX,phiX);
304 colY.setRThetaPhi(1.,thetaY,phiY);
305 colZ.setRThetaPhi(1.,thetaZ,phiZ);
306 //cout<<"will give value to rotation "<<endl;
307 HepMatrix rotation(6,6,0);
308 rotation(1,1) = colX.x();
309 rotation(1,2) = colX.y();
310 rotation(1,3) = colX.z();
311 rotation(2,1) = colY.x();
312 rotation(2,2) = colY.y();
313 rotation(2,3) = colY.z();
314 rotation(3,1) = colZ.x();
315 rotation(3,2) = colZ.y();
316 rotation(3,3) = colZ.z();
317
318 rotation(4,4) = colX.x();
319 rotation(4,5) = colX.y();
320 rotation(4,6) = colX.z();
321 rotation(5,4) = colY.x();
322 rotation(5,5) = colY.y();
323 rotation(5,6) = colY.z();
324 rotation(6,4) = colZ.x();
325 rotation(6,5) = colZ.y();
326 rotation(6,6) = colZ.z();
327 return rotation;
328}
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 42 of file ExtMucKal.h.

42{return m_samestrip;}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ JCB()

bool ExtMucKal::JCB ( )

Definition at line 237 of file ExtMucKal.cxx.

238{
239 HepMatrix m_xp_jcb(6,6,0);
240 double dx( ( m_CurrentInsct - m_CurrentPosition ).mag() );
241 double dp(0.);//dp( ( pv1 - m_pv ).mag() );
242 double p2( m_CurrentMomentum.mag2() );
243 double p_abs( sqrt( p2 ) );
244
245 double p_inv;
246 if( p_abs > Small && m_CurrentMomentum.mag() > Small ){
247 p_inv = 1.0 / p_abs;
248 } else {
249 p_inv = Infinite;
250 return 0;
251 }
252 double p2inv( p_inv * p_inv );
253 double p3inv( p2inv * p_inv );
254 double fdx( dx * p3inv );
255
256 double fdp( dp * p_inv );
257 double px( m_CurrentMomentum.x() );
258 double py( m_CurrentMomentum.y() );
259 double pz( m_CurrentMomentum.z() );
260 double px2( px * px );
261 double py2( py * py );
262 double pz2( pz * pz );
263 double pxy( px * py );
264 double pyz( py * pz );
265 double pzx( pz * px );
266 m_xp_jcb( 1, 1 ) = 1.0; // dx'/dx
267 m_xp_jcb( 1, 4 ) = fdx * ( py2 + pz2 ); // dx'/dpx
268 m_xp_jcb( 1, 5 ) = - fdx * pxy; // dx'/dpy
269 m_xp_jcb( 1, 6 ) = - fdx * pzx; // dx'/dpz
270 m_xp_jcb( 2, 2 ) = 1.0; // dy'/dy
271 m_xp_jcb( 2, 4 ) = - fdx * pxy; // dy'/dpx
272 m_xp_jcb( 2, 5 ) = fdx * ( pz2 + px2 ); // dy'/dpy
273 m_xp_jcb( 2, 6 ) = - fdx * pyz; // dy'/dpz
274
275 m_xp_jcb( 3, 3 ) = 1.0; // dz'/dz
276 m_xp_jcb( 3, 4 ) = - fdx * pzx; // dz'/dpx
277 m_xp_jcb( 3, 5 ) = - fdx * pyz; // dz'/dpy
278 m_xp_jcb( 3, 6 ) = fdx * ( px2 + py2 ); // dz'/dpz
279
280 m_xp_jcb( 4, 4 ) = 1.0 - fdp; // dx'/dx energy loss
281 m_xp_jcb( 5, 5 ) = 1.0 - fdp; // dy'/dy energy loss
282 m_xp_jcb( 6, 6 ) = 1.0 - fdp; // dz'/dz energy loss
283 m_jcb = m_xp_jcb;
284 return 1;
285 // m_CurrentInsctXPErr = m_CurrentInsct.similarity( m_xp_jcb );
286}

Referenced by MucKalIniti().

◆ MucKalIniti()

bool ExtMucKal::MucKalIniti ( )

Definition at line 150 of file ExtMucKal.cxx.

152{
153 MucGeoGap* box = MucGeoGeneral::Instance()->GetGap((int)m_gapid[0],(int)m_gapid[1],(int)m_gapid[2]);
154 Hep3Vector mom_unit= m_CurrentMomentum;
155 mom_unit.setMag(1.0);
156 HepVector3D _interc = box->ProjectToGap(m_CurrentPosition,mom_unit);
157 m_CurrentInsct = _interc;
158 HepVector3D m_CurrentInsct_loc = box->TransformToGap(m_CurrentInsct);
159 int iStrip = box->GuessStrip(m_CurrentInsct_loc.x(),m_CurrentInsct_loc.y(),m_CurrentInsct_loc.z());
160 m_iStrip =iStrip;
161 //Tuning-------------
162 /*
163 cout<<"----------------------------------------------------"<<endl;
164 cout<<"Insct pos_loc: "<<"x: "<<m_CurrentInsct_loc.x()<<" y:"<<m_CurrentInsct_loc.y()<<" z:"<<m_CurrentInsct_loc.z()<<endl;
165 cout<<"---Guess Hit---"<<"Part: "<<m_gapid[0]<<" Seg: "<<m_gapid[1]<<" Gap: "<<m_gapid[2]<<" Strip: "<<m_iStrip<<endl;
166 int stripMax = box->GetStripNum()-1;
167 if(iStrip < stripMax&&iStrip>0 )
168 {
169 MucRecHit guess_hit(m_gapid[0],m_gapid[1],m_gapid[2],m_iStrip);
170 HepPoint3D posHit = guess_hit.GetCenterPos();
171 HepPoint3D posHit_loc = box->TransformToGap(posHit);
172 cout<<"Guess Hit Pos--- "<<"x: "<<posHit_loc.x()<<" y: "<<posHit_loc.y()<<" z: "<<posHit_loc.z()<<endl;
173 }
174 */
175 //Tuning--------------
176 bool iniOK = false;
177 iniOK = JCB();
178 m_CurrentInsctXPErr = m_CurrentXPErr.similarity( m_jcb );
179 return iniOK;
180}
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 28 of file ExtMucKal.h.

28{m_gapid = id;}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ SetMucDigiCol()

void ExtMucKal::SetMucDigiCol ( MucDigiCol * amucdigi)
inline

Definition at line 26 of file ExtMucKal.h.

26{m_MucDigiCol=amucdigi;}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ SetMucWindow()

void ExtMucKal::SetMucWindow ( int aMucWindow)
inline

Definition at line 27 of file ExtMucKal.h.

27{n_sigm = aMucWindow;}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ SetPosMomErr()

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

Definition at line 25 of file ExtMucKal.h.

25{m_CurrentPosition=pos;m_CurrentMomentum=mom;m_CurrentXPErr = err;}

Referenced by ExtSteppingAction::UserSteppingAction().

◆ TrackHit()

vector< MucRecHit * > ExtMucKal::TrackHit ( )

Definition at line 78 of file ExtMucKal.cxx.

79{
80 vector<MucRecHit*> hitvec;
81 vector<MucRecHit*> HitInGap = GapHit();
82 int hitsize = HitInGap.size();
83 double dist_nearest = 9999.;
84 for ( int h = 0;h<hitsize;h++ )
85 {
86
87 MucRecHit* myhit = HitInGap[h];
88 //cout<<"Gap Hit: "<<"part: "<<myhit->Part()<<" seg: "<<myhit->Seg()<<" layer: "<<myhit->Gap()<<" strip: "<<myhit->Strip()<<endl;
89 MucGeoGap* mygap = myhit->GetGap();
90 HepMatrix rotation = GetRoationMatrix(mygap);
91 HepSymMatrix IntrErr_loc(6,0);
92 IntrErr_loc.assign(rotation*m_CurrentInsctXPErr*rotation.T());
93 float sx,sy,sz;
94 myhit->GetStrip()->GetCenterSigma(sx,sy,sz);
95 double distance = GetDistance(myhit);
96 double window = -9999.;
97 int myorient = myhit->GetGap()->Orient();
98 if(myorient==1) //strip parallel y axis
99 window = n_sigm*sqrt(IntrErr_loc(1,1)+sx*sx/12.);
100 //window = 4.*sx;
101 //{window = n_sigm*sqrt(IntrErr_loc(1,1)+sx*sx/12.);cout<<"sx: "<<sx<<endl;cout<<"window: "<<window<<endl;cout<<"window/strip: "<<floor(window/sx)<<endl;}
102 if(myorient==0)
103 window = n_sigm*sqrt(IntrErr_loc(2,2)+sy*sy/12.);
104 //window = 4.*sy;
105 //{window = n_sigm*sqrt(IntrErr_loc(2,2)+sy*sy/12.);cout<<"sy: "<<sy<<endl;cout<<"window: "<<window<<endl;cout<<"window/strip: "<<floor(window/sy)<<endl;}
106
107 //cout<<"window/strip: "<<floor(window/sx)<<endl;
108 //cout<<"distance: "<<distance<<endl;
109 if(fabs(distance)<window)
110 {
111 hitvec.push_back(myhit);
112 if(dist_nearest>fabs(distance))
113 {
114 //cout<<"Hit exist"<<endl;
115 HitExist =true;
116 dist_nearest=fabs(distance);
117 m_nearesthit = HitInGap[h];
118 }
119 }
120 }
121
122 return hitvec;
123}
vector< MucRecHit * > GapHit()

Referenced by ExtSteppingAction::UserSteppingAction().

◆ XPmod()

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

Definition at line 71 of file ExtMucKal.cxx.

72{
73 pos = m_pos_mod;
74 mom = m_mom_mod;
75 err = m_err_mod;
76}

Referenced by ExtSteppingAction::UserSteppingAction().


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