ATLAS Offline Software
Loading...
Searching...
No Matches
AlfaTrackCand Class Reference

#include <AlfaLocalHits.h>

Collaboration diagram for AlfaTrackCand:

Public Member Functions

 AlfaTrackCand (AlfaLocalHits *hits)
int IsLeftTrack ()
int IsRightTrack ()
int IsLowerArmTrack ()
int IsUpperArmTrack ()
int IsValidTrack ()
int IsLeftOrRightTrack ()
int IsLeftAndRightTrack ()
void CalcTrack ()
int GetArmNum ()
float GetX ()
float GetY ()
float GetZ ()
float GetXslope ()
float GetYslope ()
AlfaLocalHitGetNearLocalHit ()
AlfaLocalHitGetFarLocalHit ()
const ALFA_LocRecCorrEventGetNearLocRecCorr () const
const ALFA_LocRecCorrEventGetFarLocRecCorr () const
void CalcImpactPoints ()
HepGeom::Point3D< double > * GetNearImpactPoint ()
HepGeom::Point3D< double > * GetFarImpactPoint ()
void Dump () const

Private Attributes

int m_arm
float m_x
float m_y
float m_z
float m_xslope
float m_yslope
AlfaLocalHitsm_trackcandhits
AlfaLocalHitm_nearlocalhit
AlfaLocalHitm_farlocalhit
HepGeom::Point3D< double > m_nearimpactpoint
HepGeom::Point3D< double > m_farimpactpoint

Detailed Description

Definition at line 90 of file AlfaLocalHits.h.

Constructor & Destructor Documentation

◆ AlfaTrackCand()

AlfaTrackCand::AlfaTrackCand ( AlfaLocalHits * hits)

Definition at line 272 of file AlfaLocalHits.cxx.

272 {
273 // ... initialize
274 m_arm = -1.;
275 m_x = 1.e10;
276 m_y = 1.e10;
277 m_z = 1.e10;
278 m_xslope = 1.e10;
279 m_yslope = 1.e10;
280 m_nearlocalhit = nullptr;
281 m_farlocalhit = nullptr;
282
283 // ... asign hits that create the track
285
286 // ... calculate track kinematics and project track back to "pot planes"
291 cout << "Left and right side ALFA tracks at one time not supported in AlfaTrackCand class" << endl;
292 cout << "Consider using another class for them or change path pattern." << endl;
293 }
294}
AlfaLocalHits * m_trackcandhits
AlfaLocalHit * m_farlocalhit
AlfaLocalHit * m_nearlocalhit

Member Function Documentation

◆ CalcImpactPoints()

void AlfaTrackCand::CalcImpactPoints ( )

Definition at line 429 of file AlfaLocalHits.cxx.

429 {
430 // ... distance from intercept to xy plane at pot z is
431 // half of the distance between the pots
432 // ... the direction vector starting at x,y needs to be
433 // scaled to touch the plane at pot's z
434 double z_nearpot = m_nearlocalhit->GetZ();
435 double scalefactortonearpot = z_nearpot - m_z;
436 double ximpact_nearpot = m_x + m_xslope * scalefactortonearpot;
437 double yimpact_nearpot = m_y + m_yslope * scalefactortonearpot;
438 double zimpact_nearpot = z_nearpot;
439 m_nearimpactpoint.setX(ximpact_nearpot);
440 m_nearimpactpoint.setY(yimpact_nearpot);
441 m_nearimpactpoint.setZ(zimpact_nearpot);
442
443 double z_farpot = m_farlocalhit->GetZ();
444 double scalefactortofarpot = z_farpot - m_z;
445 double ximpact_farpot = m_x + m_xslope * scalefactortofarpot;
446 double yimpact_farpot = m_y + m_yslope * scalefactortofarpot;
447 double zimpact_farpot = z_farpot;
448 m_farimpactpoint.setX(ximpact_farpot);
449 m_farimpactpoint.setY(yimpact_farpot);
450 m_farimpactpoint.setZ(zimpact_farpot);
451
452}
HepGeom::Point3D< double > m_farimpactpoint
HepGeom::Point3D< double > m_nearimpactpoint

◆ CalcTrack()

void AlfaTrackCand::CalcTrack ( )

Definition at line 369 of file AlfaLocalHits.cxx.

369 {
370 float xM = 1.e10;
371 float xm = 1.e10;
372 float yM = 1.e10;
373 float ym = 1.e10;
374 float zM = 1.e10;
375 float zm = 1.e10;
376 for(int i = 0; i < m_trackcandhits->GetNhits(); i++){
378 if(m_trackcandhits->GetHit(i)->GetPotName().Contains("B7")){
379 xM = m_trackcandhits->GetHit(i)->GetX();
380 yM = m_trackcandhits->GetHit(i)->GetY();
381 zM = m_trackcandhits->GetHit(i)->GetZ();
382 m_farlocalhit = m_trackcandhits->GetHit(i);
383 }else if(m_trackcandhits->GetHit(i)->GetPotName().Contains("A7")){
384 xm = m_trackcandhits->GetHit(i)->GetX();
385 ym = m_trackcandhits->GetHit(i)->GetY();
386 zm = m_trackcandhits->GetHit(i)->GetZ();
387 m_nearlocalhit = m_trackcandhits->GetHit(i);
388 }
390 m_arm = 2;
392 m_arm = 1;
393 }else{
394 throw std::runtime_error("AlfaTrackCand::CalcTrack() ... track is in left but unknown upper/lower arm");
395 }
396 }else if(AlfaTrackCand::IsRightTrack()){
397 if(m_trackcandhits->GetHit(i)->GetPotName().Contains("B7")){
398 xm = m_trackcandhits->GetHit(i)->GetX();
399 ym = m_trackcandhits->GetHit(i)->GetY();
400 zm = m_trackcandhits->GetHit(i)->GetZ();
401 m_nearlocalhit = m_trackcandhits->GetHit(i);
402 }else if(m_trackcandhits->GetHit(i)->GetPotName().Contains("A7")){
403 xM = m_trackcandhits->GetHit(i)->GetX();
404 yM = m_trackcandhits->GetHit(i)->GetY();
405 zM = m_trackcandhits->GetHit(i)->GetZ();
406 m_farlocalhit = m_trackcandhits->GetHit(i);
407 }
409 m_arm = 4;
411 m_arm = 3;
412 }else{
413 std::runtime_error("AlfaTrackCand::CalcTrack() ... track is in right but unknown upper/lower arm");
414 }
415 }else{
416 std::runtime_error("AlfaTrackCand::CalcTrack() ... track must be left or right");
417 }
418 }
419
420 m_x = (xM + xm) / 2.;
421 m_y = (yM + ym) / 2.;
422 m_z = (zM + zm) / 2.;
423 m_xslope = (xM - xm) / (zM - zm);
424 m_yslope = (yM - ym) / (zM - zm);
425
426}

◆ Dump()

void AlfaTrackCand::Dump ( ) const

Definition at line 455 of file AlfaLocalHits.cxx.

455 {
456 std::ios oldState(nullptr);
457 oldState.copyfmt(std::cout);
458 cout << "Dumping AlfaTrackCand:" << endl;
459 cout << " arm = " << std::setprecision(8) << m_arm
460 << " x = " << std::setprecision(8) << m_x
461 << " y = " << std::setprecision(8) << m_y
462 << " z = " << std::setprecision(8) << m_z
463 << " x'= " << std::setprecision(8) << m_xslope
464 << " y' = " << std::setprecision(8) << m_yslope
465 << endl;
466 std::cout.copyfmt(oldState);
467
468}

◆ GetArmNum()

int AlfaTrackCand::GetArmNum ( )
inline

Definition at line 110 of file AlfaLocalHits.h.

110{return m_arm;};

◆ GetFarImpactPoint()

HepGeom::Point3D< double > * AlfaTrackCand::GetFarImpactPoint ( )
inline

Definition at line 122 of file AlfaLocalHits.h.

122{return &m_farimpactpoint;};

◆ GetFarLocalHit()

AlfaLocalHit * AlfaTrackCand::GetFarLocalHit ( )
inline

Definition at line 117 of file AlfaLocalHits.h.

117{return m_farlocalhit; };

◆ GetFarLocRecCorr()

const ALFA_LocRecCorrEvent * AlfaTrackCand::GetFarLocRecCorr ( ) const
inline

Definition at line 119 of file AlfaLocalHits.h.

119{return m_farlocalhit->GetLocRecCorr();}

◆ GetNearImpactPoint()

HepGeom::Point3D< double > * AlfaTrackCand::GetNearImpactPoint ( )
inline

Definition at line 121 of file AlfaLocalHits.h.

121{return &m_nearimpactpoint;};

◆ GetNearLocalHit()

AlfaLocalHit * AlfaTrackCand::GetNearLocalHit ( )
inline

Definition at line 116 of file AlfaLocalHits.h.

116{return m_nearlocalhit;};

◆ GetNearLocRecCorr()

const ALFA_LocRecCorrEvent * AlfaTrackCand::GetNearLocRecCorr ( ) const
inline

Definition at line 118 of file AlfaLocalHits.h.

118{return m_nearlocalhit->GetLocRecCorr();};

◆ GetX()

float AlfaTrackCand::GetX ( )
inline

Definition at line 111 of file AlfaLocalHits.h.

111{return m_x;};

◆ GetXslope()

float AlfaTrackCand::GetXslope ( )
inline

Definition at line 114 of file AlfaLocalHits.h.

114{return m_xslope;};

◆ GetY()

float AlfaTrackCand::GetY ( )
inline

Definition at line 112 of file AlfaLocalHits.h.

112{return m_y;};

◆ GetYslope()

float AlfaTrackCand::GetYslope ( )
inline

Definition at line 115 of file AlfaLocalHits.h.

115{return m_yslope;};

◆ GetZ()

float AlfaTrackCand::GetZ ( )
inline

Definition at line 113 of file AlfaLocalHits.h.

113{return m_z;};

◆ IsLeftAndRightTrack()

int AlfaTrackCand::IsLeftAndRightTrack ( )

Definition at line 361 of file AlfaLocalHits.cxx.

361 {
363 return 1;
364 }else{
365 return 0;
366 }
367}

◆ IsLeftOrRightTrack()

int AlfaTrackCand::IsLeftOrRightTrack ( )

Definition at line 353 of file AlfaLocalHits.cxx.

353 {
355 return 1;
356 }else{
357 return 0;
358 }
359}

◆ IsLeftTrack()

int AlfaTrackCand::IsLeftTrack ( )

Definition at line 296 of file AlfaLocalHits.cxx.

296 {
297 if((m_trackcandhits->GetPathPattern().Contains("B7L1U")
298 && m_trackcandhits->GetPathPattern().Contains("A7L1U"))
299 || (m_trackcandhits->GetPathPattern().Contains("B7L1L")
300 && m_trackcandhits->GetPathPattern().Contains("A7L1L"))
301 ){
302 MsgStream LogStream(Athena::getMessageSvc(), "ALFA_TrackCand::IsLeftTrack");
303 LogStream << MSG::DEBUG << "Track candidate is left" << endmsg;
304 return 1;
305 }else{
306 return 0;
307 }
308}
#define endmsg
IMessageSvc * getMessageSvc(bool quiet=false)

◆ IsLowerArmTrack()

int AlfaTrackCand::IsLowerArmTrack ( )

Definition at line 324 of file AlfaLocalHits.cxx.

324 {
325 if((m_trackcandhits->GetPathPattern().Contains("B7L1L")
326 && m_trackcandhits->GetPathPattern().Contains("A7L1L"))
327 || (m_trackcandhits->GetPathPattern().Contains("B7R1L")
328 && m_trackcandhits->GetPathPattern().Contains("A7R1L"))
329 ){
330 MsgStream LogStream(Athena::getMessageSvc(), "ALFA_TrackCand::IsLowerArmTrack");
331 LogStream << MSG::DEBUG << "Track candidate is in the lower arm" << endmsg;
332 return 1;
333 }else{
334 return 0;
335 }
336}

◆ IsRightTrack()

int AlfaTrackCand::IsRightTrack ( )

Definition at line 310 of file AlfaLocalHits.cxx.

310 {
311 if((m_trackcandhits->GetPathPattern().Contains("B7R1U")
312 && m_trackcandhits->GetPathPattern().Contains("A7R1U"))
313 || (m_trackcandhits->GetPathPattern().Contains("B7R1L")
314 && m_trackcandhits->GetPathPattern().Contains("A7R1L"))
315 ){
316 MsgStream LogStream(Athena::getMessageSvc(), "ALFA_TrackCand::IsRightTrack");
317 LogStream << MSG::DEBUG << "Track candidate is right" << endmsg;
318 return 1;
319 }else{
320 return 0;
321 }
322}

◆ IsUpperArmTrack()

int AlfaTrackCand::IsUpperArmTrack ( )

Definition at line 338 of file AlfaLocalHits.cxx.

338 {
339 if((m_trackcandhits->GetPathPattern().Contains("B7L1U")
340 && m_trackcandhits->GetPathPattern().Contains("A7L1U"))
341 || (m_trackcandhits->GetPathPattern().Contains("B7R1U")
342 && m_trackcandhits->GetPathPattern().Contains("A7R1U"))
343 ){
344 MsgStream LogStream(Athena::getMessageSvc(), "ALFA_TrackCand::IsUpperArmTrack");
345 LogStream << MSG::DEBUG << "Track candidate is in the upper arm" << endmsg;
346 return 1;
347 }else{
348 return 0;
349 }
350}

◆ IsValidTrack()

int AlfaTrackCand::IsValidTrack ( )
inline

Definition at line 106 of file AlfaLocalHits.h.

106{return (m_nearlocalhit && m_farlocalhit);};

Member Data Documentation

◆ m_arm

int AlfaTrackCand::m_arm
private

Definition at line 92 of file AlfaLocalHits.h.

◆ m_farimpactpoint

HepGeom::Point3D<double> AlfaTrackCand::m_farimpactpoint
private

Definition at line 99 of file AlfaLocalHits.h.

◆ m_farlocalhit

AlfaLocalHit* AlfaTrackCand::m_farlocalhit
private

Definition at line 97 of file AlfaLocalHits.h.

◆ m_nearimpactpoint

HepGeom::Point3D<double> AlfaTrackCand::m_nearimpactpoint
private

Definition at line 98 of file AlfaLocalHits.h.

◆ m_nearlocalhit

AlfaLocalHit* AlfaTrackCand::m_nearlocalhit
private

Definition at line 96 of file AlfaLocalHits.h.

◆ m_trackcandhits

AlfaLocalHits* AlfaTrackCand::m_trackcandhits
private

Definition at line 95 of file AlfaLocalHits.h.

◆ m_x

float AlfaTrackCand::m_x
private

Definition at line 93 of file AlfaLocalHits.h.

◆ m_xslope

float AlfaTrackCand::m_xslope
private

Definition at line 94 of file AlfaLocalHits.h.

◆ m_y

float AlfaTrackCand::m_y
private

Definition at line 93 of file AlfaLocalHits.h.

◆ m_yslope

float AlfaTrackCand::m_yslope
private

Definition at line 94 of file AlfaLocalHits.h.

◆ m_z

float AlfaTrackCand::m_z
private

Definition at line 93 of file AlfaLocalHits.h.


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