QwAnalysis
QwBridgingTrackFilter Class Reference

Track filter for the bridging methods. More...

#include <QwBridgingTrackFilter.h>

Public Types

enum  EStatus {
  kPass = 0, kFailThetaFront, kFailThetaBack, kFailPhiFront,
  kFailPhiBack, kFailDiffTheta, kFailDiffPhi, kFailVertexZ,
  kFailUnknown
}
 List of possible failure modes for the filter. More...
 

Public Member Functions

 QwBridgingTrackFilter ()
 Default constructor. More...
 
virtual ~QwBridgingTrackFilter ()
 Destructor. More...
 
EStatus Filter (const QwPartialTrack *front, const QwPartialTrack *back) const
 Filter front and back track combinations. More...
 

Private Attributes

double fMinTheta
 Angle and position boundaries for the filter. More...
 
double fMaxTheta
 
double fMinPhi
 
double fMaxPhi
 
double fMinDiffTheta
 
double fMaxDiffTheta
 
double fMinDiffPhi
 
double fMaxDiffPhi
 
double fMinVertexZ
 
double fMaxVertexZ
 

Detailed Description

Track filter for the bridging methods.

Not all combinations of front and back tracks lead to a valid bridged track. This object filters combinations of front and back tracks and only accepts combinations that satisfy certain criteria.

Definition at line 32 of file QwBridgingTrackFilter.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

QwBridgingTrackFilter::QwBridgingTrackFilter ( )

Default constructor.

Definition at line 11 of file QwBridgingTrackFilter.cc.

References Qw::cm, Qw::deg, fMaxDiffPhi, fMaxDiffTheta, fMaxPhi, fMaxTheta, fMaxVertexZ, fMinDiffPhi, fMinDiffTheta, fMinPhi, fMinTheta, and fMinVertexZ.

12 {
13  // Set default filter criteria
14  // - polar angle, should probably be split in front and back
15  fMinTheta = 1.0 * Qw::deg;
16  fMaxTheta = 13.0 * Qw::deg;
17  // - difference in polar angle between front and back
18  fMinDiffTheta = 5.0 * Qw::deg;
19  fMaxDiffTheta = 45.0 * Qw::deg;
20  // - azimuthal angle
21  fMinPhi = 0.0 * Qw::deg;
22  fMaxPhi = 360.0 * Qw::deg;
23  // - difference in azimuthal angle between front and back
24  fMinDiffPhi = - 20.0 * Qw::deg;
25  fMaxDiffPhi = 20.0 * Qw::deg;
26  // - longitudinal vertex position in target
27  fMinVertexZ = -672.0 * Qw::cm;
28  fMaxVertexZ = -628.0 * Qw::cm;
29 }
double fMinTheta
Angle and position boundaries for the filter.
static const double deg
Definition: QwUnits.h:106
static const double cm
Length units: base unit is mm.
Definition: QwUnits.h:61
virtual QwBridgingTrackFilter::~QwBridgingTrackFilter ( )
inlinevirtual

Destructor.

Definition at line 39 of file QwBridgingTrackFilter.h.

39 { };

Member Function Documentation

QwBridgingTrackFilter::EStatus QwBridgingTrackFilter::Filter ( const QwPartialTrack front,
const QwPartialTrack back 
) const

Filter front and back track combinations.

Filter combinations of front and back partial tracks before bridging

Parameters
frontFront partial track
backBack partial track
Returns
Failure code (zero when accepted)

Definition at line 40 of file QwBridgingTrackFilter.cc.

References Qw::cm, Qw::deg, QwLog::endl(), fMaxDiffPhi, fMaxDiffTheta, fMaxTheta, fMaxVertexZ, fMinDiffPhi, fMinDiffTheta, fMinTheta, QwPartialTrack::fOffsetX, QwPartialTrack::fOffsetY, QwPartialTrack::fSlopeX, QwPartialTrack::fSlopeY, QwPartialTrack::GetMomentumDirection(), QwPartialTrack::GetMomentumDirectionPhi(), QwPartialTrack::GetMomentumDirectionTheta(), QwPartialTrack::GetPosition(), kFailDiffPhi, kFailDiffTheta, kFailThetaFront, kFailVertexZ, kPass, and QwDebug.

Referenced by main(), and QwTrackingWorker::ProcessEvent().

42 {
43  // NOTE The angle limits will be determined from MC simulation results
44 
45  // Scattering angle limit
46  double theta = front->GetMomentumDirectionTheta();
47  if ((theta < fMinTheta) || (theta > fMaxTheta)) {
48  QwDebug << "QwBridgingTrackFilter: theta = " << theta/Qw::deg << " deg, "
49  << "allowed range [" << fMinTheta/Qw::deg << ","
50  << fMaxTheta/Qw::deg << "] deg" << QwLog::endl;
51  return kFailThetaFront;
52  }
53 
54  // Bending angle limits in the magnetic field
55  double dtheta = (back->GetMomentumDirectionTheta() - front->GetMomentumDirectionTheta());
56  if ((dtheta < fMinDiffTheta) || (dtheta > fMaxDiffTheta)) {
57  // QwMessage << "QwBridgingTrackFilter: dtheta = " << dtheta/Qw::deg << " deg, "
58  // << "allowed range [" << fMinDiffTheta/Qw::deg << ","
59  // << fMaxDiffTheta/Qw::deg << "] deg" << QwLog::endl;
60  return kFailDiffTheta;
61  }
62  double dphi = (back->GetMomentumDirectionPhi() - front->GetMomentumDirectionPhi());
63  if ((dphi < fMinDiffPhi) || (dphi > fMaxDiffPhi)) {
64  // QwMessage << "QwBridgingTrackFilter: dphi = " << dphi/Qw::deg << " deg, "
65  // << "allowed range [" << fMinDiffPhi/Qw::deg << ","
66  // << fMaxDiffPhi/Qw::deg << "] deg" << QwLog::endl;
67  return kFailDiffPhi;
68  }
69 
70  // Scattering vertex limits and position phi limits (QTOR keep-out zone)
71  TVector3 start_position = front->GetPosition(-330.685 * Qw::cm);
72  TVector3 start_direction = front->GetMomentumDirection();
73  // front track position and angles at z = -250 cm plane
74  //double r = fabs(start_position.Z() - (-250.0 * Qw::cm)) / start_direction.Z(); // unused
75  //double x = start_position.X() + r * start_direction.X(); // unused
76  //double y = start_position.Y() + r * start_direction.Y(); // unused
77 
78  // double position_r = sqrt(x*x + y*y);
79  double position_phi = start_position.Phi();
80  //double direction_theta = direction_theta = front->GetMomentumDirectionTheta(); // unused
81 
82  //double vertex_z = -250.0 * Qw::cm - position_r / tan(acos(start_direction.Z()));
83  double vertex_z=-(front->fSlopeX*front->fOffsetX + front->fSlopeY*front->fOffsetY)/(front->fSlopeX*front->fSlopeX+front->fSlopeY*front->fSlopeY);
84  if (vertex_z < fMinVertexZ || vertex_z > fMaxVertexZ) {
85  // QwMessage << "QwBridgingTrackFilter: vertex z = " << vertex_z/Qw::cm << " cm, "
86  // << "allowed range [" << fMinVertexZ/Qw::cm << ","
87  // << fMaxVertexZ/Qw::cm << "] cm" << QwLog::endl;
88  return kFailVertexZ;
89  }
90 
91  // scattering angle phi and the position_phi at Region 2 should have very small difference
92  // this will post a limit on the phi difference
93  double direction_phi = 0.0;
94  direction_phi = front->GetMomentumDirectionPhi();
95  double delta_front_phi = fabs(direction_phi - position_phi);
96  if (delta_front_phi> 5.0*Qw::deg) {
97  // QwMessage << "QwBridgingTrackFilter: delta_front_phi = " << delta_front_phi/Qw::deg << " deg, "
98  // << "allowed range [-5, 5] cm" << QwLog::endl;
99  return kFailVertexZ;
100  }
101 
102  // TODO: add in QTOR keep-out zones
103 
104  return kPass;
105 }
Double_t fOffsetX
x coordinate (at MAGNET_CENTER)
Double_t fSlopeY
y slope
double fMinTheta
Angle and position boundaries for the filter.
static const double deg
Definition: QwUnits.h:106
Double_t GetMomentumDirectionTheta() const
Return the theta angle.
const TVector3 GetPosition(const double z) const
Return the vertex at position z.
#define QwDebug
Predefined log drain for debugging output.
Definition: QwLog.h:60
const TVector3 GetMomentumDirection() const
Return the direction.
Double_t fSlopeX
x slope
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
Double_t fOffsetY
y coordinate (at MAGNET_CENTER)
Double_t GetMomentumDirectionPhi() const
Return the phi angle.
static const double cm
Length units: base unit is mm.
Definition: QwUnits.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

double QwBridgingTrackFilter::fMaxDiffPhi
private

Definition at line 70 of file QwBridgingTrackFilter.h.

Referenced by Filter(), and QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMaxDiffTheta
private

Definition at line 68 of file QwBridgingTrackFilter.h.

Referenced by Filter(), and QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMaxPhi
private

Definition at line 66 of file QwBridgingTrackFilter.h.

Referenced by QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMaxTheta
private

Definition at line 64 of file QwBridgingTrackFilter.h.

Referenced by Filter(), and QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMaxVertexZ
private

Definition at line 72 of file QwBridgingTrackFilter.h.

Referenced by Filter(), and QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMinDiffPhi
private

Definition at line 69 of file QwBridgingTrackFilter.h.

Referenced by Filter(), and QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMinDiffTheta
private

Definition at line 67 of file QwBridgingTrackFilter.h.

Referenced by Filter(), and QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMinPhi
private

Definition at line 65 of file QwBridgingTrackFilter.h.

Referenced by QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMinTheta
private

Angle and position boundaries for the filter.

Todo:
Setters for the filter angle boundaries (wdc)

Definition at line 63 of file QwBridgingTrackFilter.h.

Referenced by Filter(), and QwBridgingTrackFilter().

double QwBridgingTrackFilter::fMinVertexZ
private

Definition at line 71 of file QwBridgingTrackFilter.h.

Referenced by QwBridgingTrackFilter().


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