Hall-D Software
alpha
|
#include <DReferenceTrajectory.h>
Classes | |
class | swim_step_t |
Public Types | |
enum | direction_t { kForward, kBackward } |
This class is a utility class used by the TRACKING package. It is used to swim a particle through the (inhomogeneous) magnetic field, accounting for energy loss in the geometry, and recording each step so that derivatives and distances can be calculated. Because this uses the coordinates defined in the reference trajectory method (B. Mecking Nucl. Instr. and Methods. 203 (1982) 299-305), the angles needed to rotate into the lab frame are saved as well. This used the DMagneticFieldStepper class for swimming through the field. More... | |
enum | state_t { kPx, kPy, kPz, kX, kY, kZ, kT } |
Public Member Functions | |
DReferenceTrajectory (const DMagneticFieldMap *, double q=1.0, swim_step_t *swim_steps=NULL, int max_swim_steps=0, double step_size=-1.0) | |
DReferenceTrajectory (const DReferenceTrajectory &rt) | |
DReferenceTrajectory & | operator= (const DReferenceTrajectory &rt) |
virtual | ~DReferenceTrajectory () |
virtual const char * | className (void) |
void | CopyWithShift (const DReferenceTrajectory *rt, DVector3 shift) |
void | Reset (void) |
double | DistToRT (double x, double y, double z) const |
double | DistToRT (DVector3 hit, double *s=NULL, DetectorSystem_t detector=SYS_NULL) const |
double | DistToRTwithTime (DVector3 hit, double *s=NULL, double *t=NULL, double *var_t=NULL, DetectorSystem_t detector=SYS_NULL) const |
double | DistToRT (const DCoordinateSystem *wire, double *s=NULL) const |
double | DistToRTBruteForce (const DCoordinateSystem *wire, double *s=NULL) const |
double | DistToRT (const DCoordinateSystem *wire, const swim_step_t *step, double *s=NULL) const |
double | DistToRTBruteForce (const DCoordinateSystem *wire, const swim_step_t *step, double *s=NULL) const |
double | Straw_dx (const DCoordinateSystem *wire, double radius) const |
swim_step_t * | FindClosestSwimStep (const DCoordinateSystem *wire, int *istep_ptr=NULL) const |
swim_step_t * | FindClosestSwimStep (const DVector3 &origin, DVector3 norm, int *istep_ptr=NULL) const |
swim_step_t * | FindPlaneCrossing (const DVector3 &origin, DVector3 norm, int first_i=0, DetectorSystem_t detector=SYS_NULL) const |
void | Swim (const DVector3 &pos, const DVector3 &mom, double q=-1000.0, const TMatrixFSym *cov=NULL, double smax=2000.0, const DCoordinateSystem *wire=NULL) |
void | FastSwim (const DVector3 &pos, const DVector3 &mom, double q, double smax=2000.0, double zmin=-100., double zmax=1000.0) |
void | FastSwimForHitSelection (const DVector3 &pos, const DVector3 &mom, double q) |
void | FastSwim (const DVector3 &pos, const DVector3 &mom, DVector3 &last_pos, DVector3 &last_mom, double q, double smax=2000.0, const DCoordinateSystem *wire=NULL) |
void | FastSwim (const DVector3 &pos, const DVector3 &mom, DVector3 &last_pos, DVector3 &last_mom, double q, const DVector3 &origin, const DVector3 &dir, double smax=2000.0) |
int | InsertSteps (const swim_step_t *start_step, double delta_s, double step_size=0.02) |
jerror_t | GetIntersectionWithPlane (const DVector3 &origin, const DVector3 &norm, DVector3 &pos, double *s=NULL, double *t=NULL, double *var_t=NULL, DetectorSystem_t detector=SYS_NULL) const |
jerror_t | GetIntersectionWithPlane (const DVector3 &origin, const DVector3 &norm, DVector3 &pos, DVector3 &p_at_intersection, double *s=NULL, double *t=NULL, double *var_t=NULL, DetectorSystem_t detector=SYS_NULL) const |
jerror_t | GetIntersectionWithRadius (double R, DVector3 &mypos, double *s=NULL, double *t=NULL, DVector3 *dir=NULL) const |
DVector3 | GetLastDOCAPoint (void) const |
void | GetLastDOCAPoint (DVector3 &pos, DVector3 &mom) const |
jerror_t | FindPOCAtoPoint (const DVector3 &point, const DMatrixDSym *covpoint, DKinematicData *track_kd, double &doca, double &var_doca) const |
jerror_t | FindPOCAtoLine (const DVector3 &origin, const DVector3 &dir, const DMatrixDSym *covpoint, DKinematicData *track_kd, DVector3 &commonpos, double &doca, double &var_doca) const |
double | GetLastDistAlongWire (void) const |
void | SetStepSize (double step_size) |
void | SetDRootGeom (const DRootGeom *RootGeom) |
void | SetDGeometry (const DGeometry *geom) |
const DRootGeom * | GetDRootGeom (void) const |
const DGeometry * | GetDGeometry (void) const |
const DMagneticFieldMap * | GetBfield (void) const |
double | GetMass (void) const |
double | GetStepSize (void) const |
void | SetMass (double mass) |
void | SetPLossDirection (direction_t direction) |
void | SetCheckMaterialBoundaries (bool check_material_boundaries) |
bool | GetCheckMaterialBoundaries (void) const |
direction_t | GetPLossDirection (void) const |
double | GetBoundaryStepFraction (void) const |
double | GetMinStepSize (void) const |
double | GetMaxStepSize (void) const |
double | dPdx_from_A_Z_rho (double ptot, double A, double Z, double density) const |
double | dPdx (double ptot, double KrhoZ_overA, double rhoZ_overA, double LogI) const |
bool | GetHitCDCEndplate (void) const |
void | SetZmaxTrackingBoundary (double zmax) |
void | SetZminTrackingBoundary (double zmin) |
double | GetZmaxTrackingBoundary (void) |
double | GetZminTrackingBoundary (void) |
int | GetDebugLevel (void) |
void | SetDebugLevel (int new_level) |
void | Dump (double zmin=-1000.0, double zmax=1000.0) |
const swim_step_t * | GetLastSwimStep (void) const |
jerror_t | IntersectTracks (const DReferenceTrajectory *rt2, DKinematicData *track1_kd, DKinematicData *track2_kd, DVector3 &pos, double &doca, double &var_doca, double &vertex_chi2, bool DoFitVertex=false) const |
jerror_t | PropagateCovariance (double ds, double q, double mass_sq, const DVector3 &mom, const DVector3 &pos, const DVector3 &B, TMatrixFSym &C) const |
jerror_t | BrentsAlgorithm (DVector3 &pos1, DVector3 &mom1, DVector3 &pos2, DVector3 &mom2, double ds, double q2, double &doca) const |
void | FitVertex (const DVector3 &pos1, const DVector3 &mom1, const DVector3 &pos2, const DVector3 &mom2, const TMatrixFSym &cov1, const TMatrixFSym &cov2, DVector3 &pos, double &vertex_chi2, double q1=1., double q2=1.) const |
Static Public Member Functions | |
static const char * | static_className (void) |
Public Attributes | |
swim_step_t * | swim_steps |
int | Nswim_steps |
float | q |
int | index_at_bcal |
int | index_at_tof |
int | index_at_fcal |
double | Rsqmax_interior |
double | Rsqmax_exterior |
Protected Attributes | |
int | debug_level |
int | max_swim_steps |
bool | own_swim_steps |
int | dist_to_rt_depth |
double | step_size |
const DMagneticFieldMap * | bfield |
const DRootGeom * | RootGeom |
const DGeometry * | geom |
direction_t | ploss_direction |
bool | check_material_boundaries |
double | zmin_track_boundary |
double | zmax_track_boundary |
double | last_phi |
last phi found in DistToRT More... | |
const swim_step_t * | last_swim_step |
last swim step used in DistToRT More... | |
double | last_dist_along_wire |
double | last_dz_dphi |
double | mass |
double | mass_sq |
bool | hit_cdc_endplate |
double | BOUNDARY_STEP_FRACTION |
double | MIN_STEP_SIZE |
double | MAX_STEP_SIZE |
Static Protected Attributes | |
static thread_local shared_ptr < DResourcePool< TMatrixFSym > > | dResourcePool_TMatrixFSym = std::make_shared<DResourcePool<TMatrixFSym>>(10, 10, 50) |
Private Member Functions | |
DReferenceTrajectory () | |
Definition at line 32 of file DReferenceTrajectory.h.
This class is a utility class used by the TRACKING package. It is used to swim a particle through the (inhomogeneous) magnetic field, accounting for energy loss in the geometry, and recording each step so that derivatives and distances can be calculated. Because this uses the coordinates defined in the reference trajectory method (B. Mecking Nucl. Instr. and Methods. 203 (1982) 299-305), the angles needed to rotate into the lab frame are saved as well. This used the DMagneticFieldStepper class for swimming through the field.
Enumerator | |
---|---|
kForward | |
kBackward |
Definition at line 46 of file DReferenceTrajectory.h.
Enumerator | |
---|---|
kPx | |
kPy | |
kPz | |
kX | |
kY | |
kZ | |
kT |
Definition at line 50 of file DReferenceTrajectory.h.
DReferenceTrajectory::DReferenceTrajectory | ( | const DMagneticFieldMap * | bfield, |
double | q = 1.0 , |
||
swim_step_t * | swim_steps = NULL , |
||
int | max_swim_steps = 0 , |
||
double | step_size = -1.0 |
||
) |
Definition at line 32 of file DReferenceTrajectory.cc.
References MIN_STEP_SIZE.
DReferenceTrajectory::DReferenceTrajectory | ( | const DReferenceTrajectory & | rt | ) |
The copy constructor will always allocate its own memory for the swim steps and set its internal flag to indicate that is owns them regardless of the owner of the source trajectory's.
Definition at line 94 of file DReferenceTrajectory.cc.
References bfield, debug_level, geom, GetBoundaryStepFraction(), GetCheckMaterialBoundaries(), GetMass(), GetMaxStepSize(), GetMinStepSize(), last_dist_along_wire, last_dz_dphi, last_phi, last_swim_step, max_swim_steps, MIN_STEP_SIZE, Nswim_steps, ploss_direction, q, RootGeom, step_size, and swim_steps.
|
virtual |
Definition at line 202 of file DReferenceTrajectory.cc.
|
inlineprivate |
Definition at line 232 of file DReferenceTrajectory.h.
jerror_t DReferenceTrajectory::BrentsAlgorithm | ( | DVector3 & | pos1, |
DVector3 & | mom1, | ||
DVector3 & | pos2, | ||
DVector3 & | mom2, | ||
double | ds, | ||
double | q2, | ||
double & | doca | ||
) | const |
Definition at line 2862 of file DReferenceTrajectory.cc.
References CGOLD, e, EPS2, DMagneticFieldStepper::GetMomentum(), ITMAX, SHFT, SIGN, DMagneticFieldStepper::Step(), u, x, and ZEPS.
|
inlinevirtual |
Definition at line 85 of file DReferenceTrajectory.h.
References static_className().
void DReferenceTrajectory::CopyWithShift | ( | const DReferenceTrajectory * | rt, |
DVector3 | shift | ||
) |
Definition at line 212 of file DReferenceTrajectory.cc.
|
inline |
Definition at line 91 of file DReferenceTrajectory.h.
References DistToRT().
Referenced by DistToRT(), DEventProcessor_fdc_covariance_hists::evnt(), DEventProcessor_cdc_covariance_hists::evnt(), DEventProcessor_cdc_hists::evnt(), DEventProcessor_track_hists::evnt(), DEventProcessor_candidate_tree::evnt(), DTrackFitterALT1::FillDebugHists(), DEventProcessor_trackeff_hists2::FindLR(), DTrackFitterALT1::FitTrack(), DTrackFitterALT1::ForceLRTruth(), DTrackHitSelectorALT1::GetCDCHits(), DTrackHitSelectorALT2::GetCDCHits(), DTrackHitSelectorALT1::GetFDCHits(), DTrackHitSelectorALT2::GetFDCHits(), DTrackFitterALT1::GetHits(), and DTrackFitterALT1::GetResiInfo().
double DReferenceTrajectory::DistToRT | ( | DVector3 | hit, |
double * | s = NULL , |
||
DetectorSystem_t | detector = SYS_NULL |
||
) | const |
Definition at line 1292 of file DReferenceTrajectory.cc.
References _DBG_, _DBG__, alpha, c, DReferenceTrajectory::swim_step_t::mom, ONE_THIRD, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, DCoordinateSystem::sdir, sin(), sqrt(), SYS_BCAL, SYS_FCAL, SYS_TOF, DCoordinateSystem::tdir, temp, TWO_THIRD, and DCoordinateSystem::udir.
double DReferenceTrajectory::DistToRT | ( | const DCoordinateSystem * | wire, |
double * | s = NULL |
||
) | const |
Find the closest distance to the given wire in cm. The value of "L" should be the active wire length (in cm). The coordinate system defined by "wire" should have its origin at the center of the wire with the wire running in the direction of udir.
Definition at line 1747 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::s.
double DReferenceTrajectory::DistToRT | ( | const DCoordinateSystem * | wire, |
const swim_step_t * | step, | ||
double * | s = NULL |
||
) | const |
Calculate the distance of the given wire(in the lab reference frame) to the Reference Trajectory which the given swim step belongs to. This uses the momentum directions and positions of the swim step to define a curve and calculate the distance of the hit from it. The swim step should be the closest one to the wire. IMPORTANT: This approximates the helix locally by a parabola. This means the swim step should be fairly close to the wire so that this approximation is valid. If the reference trajectory from which the swim step came is too sparse, the results will not be nearly as good.
Definition at line 1775 of file DReferenceTrajectory.cc.
References _DBG_, c, F, G, h, H, DCoordinateSystem::L, DReferenceTrajectory::swim_step_t::mom, ONE_THIRD, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, S, DCoordinateSystem::sdir, sin(), sqrt(), DCoordinateSystem::tdir, temp, u, DCoordinateSystem::udir, x, and y.
double DReferenceTrajectory::DistToRTBruteForce | ( | const DCoordinateSystem * | wire, |
double * | s = NULL |
||
) | const |
Find the closest distance to the given wire in cm. The value of "L" should be the active wire length (in cm). The coordinate system defined by "wire" should have its origin at the center of the wire with the wire running in the direction of udir.
Definition at line 1761 of file DReferenceTrajectory.cc.
double DReferenceTrajectory::DistToRTBruteForce | ( | const DCoordinateSystem * | wire, |
const swim_step_t * | step, | ||
double * | s = NULL |
||
) | const |
Calculate the distance of the given wire(in the lab reference frame) to the Reference Trajectory which the given swim step belongs to. This uses the momentum directions and positions of the swim step to define a curve and calculate the distance of the hit from it. The swim step should be the closest one to the wire. IMPORTANT: This calculates the distance using a "brute force" method of taking tiny swim steps to find the minimum distance. It is vey SLOW and you should be using DistToRT(...) instead. This is only here to provide an independent check of DistToRT(...).
Definition at line 2143 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, DCoordinateSystem::sdir, sin(), sqrt(), DCoordinateSystem::tdir, and DCoordinateSystem::udir.
double DReferenceTrajectory::DistToRTwithTime | ( | DVector3 | hit, |
double * | s = NULL , |
||
double * | t = NULL , |
||
double * | var_t = NULL , |
||
DetectorSystem_t | detector = SYS_NULL |
||
) | const |
Definition at line 1262 of file DReferenceTrajectory.cc.
References SPEED_OF_LIGHT, and sqrt().
Referenced by DParticleID::Distance_ToTrack().
|
inline |
|
inline |
Definition at line 2348 of file DReferenceTrajectory.cc.
void DReferenceTrajectory::Dump | ( | double | zmin = -1000.0 , |
double | zmax = 1000.0 |
||
) |
Definition at line 2435 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, py, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, DReferenceTrajectory::swim_step_t::t, x, and y.
void DReferenceTrajectory::FastSwim | ( | const DVector3 & | pos, |
const DVector3 & | mom, | ||
double | q, | ||
double | smax = 2000.0 , |
||
double | zmin = -100. , |
||
double | zmax = 1000.0 |
||
) |
(Re)Swim the trajectory starting from pos with momentum mom. This will use the charge and step size (if given) passed to the constructor when the object was created. It will also (re)use the swim_step buffer, replacing it's contents.
Definition at line 429 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::B, DMagneticFieldStepper::FastStep(), DMagneticFieldStepper::GetBField(), DMagneticFieldStepper::GetDirs(), DMagneticFieldStepper::GetPosMom(), DMagneticFieldStepper::GetRo(), DReferenceTrajectory::swim_step_t::invX0, DReferenceTrajectory::swim_step_t::itheta02, DReferenceTrajectory::swim_step_t::itheta02s, DReferenceTrajectory::swim_step_t::itheta02s2, MIN_STEP_SIZE, DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, DCoordinateSystem::sdir, DMagneticFieldStepper::SetStartingParams(), DMagneticFieldStepper::SetStepSize(), SPEED_OF_LIGHT, sqrt(), DReferenceTrajectory::swim_step_t::t, DCoordinateSystem::tdir, DCoordinateSystem::udir, and X0.
Referenced by DTrackFitter::CorrectForELoss().
void DReferenceTrajectory::FastSwim | ( | const DVector3 & | pos, |
const DVector3 & | mom, | ||
DVector3 & | last_pos, | ||
DVector3 & | last_mom, | ||
double | q, | ||
double | smax = 2000.0 , |
||
const DCoordinateSystem * | wire = NULL |
||
) |
Definition at line 245 of file DReferenceTrajectory.cc.
References DCoordinateSystem::origin, and DCoordinateSystem::udir.
void DReferenceTrajectory::FastSwim | ( | const DVector3 & | pos, |
const DVector3 & | mom, | ||
DVector3 & | last_pos, | ||
DVector3 & | last_mom, | ||
double | q, | ||
const DVector3 & | origin, | ||
const DVector3 & | dir, | ||
double | smax = 2000.0 |
||
) |
Definition at line 253 of file DReferenceTrajectory.cc.
References DMagneticFieldStepper::GetPosMom(), MIN_STEP_SIZE, DMagneticFieldStepper::SetStartingParams(), DMagneticFieldStepper::SetStepSize(), DMagneticFieldStepper::Step(), and X0.
void DReferenceTrajectory::FastSwimForHitSelection | ( | const DVector3 & | pos, |
const DVector3 & | mom, | ||
double | q | ||
) |
Definition at line 320 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::B, DMagneticFieldStepper::FastStep(), DMagneticFieldStepper::GetBField(), DMagneticFieldStepper::GetDirs(), DMagneticFieldStepper::GetPosMom(), DMagneticFieldStepper::GetRo(), DReferenceTrajectory::swim_step_t::invX0, DReferenceTrajectory::swim_step_t::itheta02, DReferenceTrajectory::swim_step_t::itheta02s, DReferenceTrajectory::swim_step_t::itheta02s2, MIN_STEP_SIZE, DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, DCoordinateSystem::sdir, DMagneticFieldStepper::SetStartingParams(), DMagneticFieldStepper::SetStepSize(), sqrt(), DReferenceTrajectory::swim_step_t::t, DCoordinateSystem::tdir, DCoordinateSystem::udir, and X0.
Referenced by DTrackWireBased_factory::DoFit().
DReferenceTrajectory::swim_step_t * DReferenceTrajectory::FindClosestSwimStep | ( | const DCoordinateSystem * | wire, |
int * | istep_ptr = NULL |
||
) | const |
Find the closest swim step to the given wire. The value of "L" should be the active wire length. The coordinate system defined by "wire" should have its origin at the center of the wire with the wire running in the direction of udir.
Definition at line 1533 of file DReferenceTrajectory.cc.
References _DBG_, DCoordinateSystem::L, DCoordinateSystem::origin, u, and DCoordinateSystem::udir.
Referenced by DTrackFitterALT1::FitTrack().
DReferenceTrajectory::swim_step_t * DReferenceTrajectory::FindClosestSwimStep | ( | const DVector3 & | origin, |
DVector3 | norm, | ||
int * | istep_ptr = NULL |
||
) | const |
Find the closest swim step to the plane specified by origin and norm. origin should indicate any point in the plane and norm a vector normal to the plane.
Definition at line 1623 of file DReferenceTrajectory.cc.
References _DBG_, and DCoordinateSystem::origin.
DReferenceTrajectory::swim_step_t * DReferenceTrajectory::FindPlaneCrossing | ( | const DVector3 & | origin, |
DVector3 | norm, | ||
int | first_i = 0 , |
||
DetectorSystem_t | detector = SYS_NULL |
||
) | const |
Find the closest swim step to the position where the track crosses the plane specified by origin and norm. origin should indicate any point in the plane and norm a vector normal to the plane.
Definition at line 1675 of file DReferenceTrajectory.cc.
References _DBG_, DCoordinateSystem::origin, and SYS_START.
jerror_t DReferenceTrajectory::FindPOCAtoLine | ( | const DVector3 & | origin, |
const DVector3 & | dir, | ||
const DMatrixDSym * | covpoint, | ||
DKinematicData * | track_kd, | ||
DVector3 & | commonpos, | ||
double & | doca, | ||
double & | var_doca | ||
) | const |
Definition at line 2525 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::B, DKinematicData::errorMatrix(), DMagneticFieldStepper::GetMomentum(), DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::s, DKinematicData::setErrorMatrix(), DKinematicData::setMomentum(), DKinematicData::setPosition(), DKinematicData::setTime(), SPEED_OF_LIGHT, sqrt(), DMagneticFieldStepper::Step(), DReferenceTrajectory::swim_step_t::t, and DKinematicData::time().
Referenced by JEventProcessor_dumpcandidates::evnt().
jerror_t DReferenceTrajectory::FindPOCAtoPoint | ( | const DVector3 & | point, |
const DMatrixDSym * | covpoint, | ||
DKinematicData * | track_kd, | ||
double & | doca, | ||
double & | var_doca | ||
) | const |
Definition at line 2676 of file DReferenceTrajectory.cc.
References dir.
|
inline |
Definition at line 143 of file DReferenceTrajectory.h.
References bfield.
|
inline |
Definition at line 151 of file DReferenceTrajectory.h.
References BOUNDARY_STEP_FRACTION.
Referenced by DReferenceTrajectory(), and operator=().
|
inline |
Definition at line 149 of file DReferenceTrajectory.h.
References check_material_boundaries.
Referenced by DReferenceTrajectory(), and operator=().
|
inline |
Definition at line 162 of file DReferenceTrajectory.h.
References debug_level.
|
inline |
Definition at line 142 of file DReferenceTrajectory.h.
References geom.
|
inline |
Definition at line 141 of file DReferenceTrajectory.h.
References RootGeom.
|
inline |
Definition at line 156 of file DReferenceTrajectory.h.
References hit_cdc_endplate.
jerror_t DReferenceTrajectory::GetIntersectionWithPlane | ( | const DVector3 & | origin, |
const DVector3 & | norm, | ||
DVector3 & | pos, | ||
double * | s = NULL , |
||
double * | t = NULL , |
||
double * | var_t = NULL , |
||
DetectorSystem_t | detector = SYS_NULL |
||
) | const |
Definition at line 984 of file DReferenceTrajectory.cc.
Referenced by DParticleID::Distance_ToTrack(), DParticleID::Get_ClosestTOFPaddleHit_Horizontal(), DParticleID::Get_ClosestTOFPaddleHit_Vertical(), MyProcessor::GetIntersectionWithCalorimeter(), DParticleID::PredictFCALHit(), DParticleID::PredictTOFPaddles(), and DParticleID::ProjectTo_SC().
jerror_t DReferenceTrajectory::GetIntersectionWithPlane | ( | const DVector3 & | origin, |
const DVector3 & | norm, | ||
DVector3 & | pos, | ||
DVector3 & | p_at_intersection, | ||
double * | s = NULL , |
||
double * | t = NULL , |
||
double * | var_t = NULL , |
||
DetectorSystem_t | detector = SYS_NULL |
||
) | const |
Get the intersection point of this trajectory with a plane. The plane is specified by origin and norm. The origin vector should give the coordinates of any point on the plane and norm should give a vector normal to the plane. The norm vector will be copied and normalized so it can be of any magnitude upon entry.
The coordinates of the intersection point will copied into the supplied pos vector. If a non-NULL pointer for s is passed in, the pathlength of the trajectory from its begining to the intersection point is copied into location pointed to.
Definition at line 988 of file DReferenceTrajectory.cc.
References _DBG_, DReferenceTrajectory::swim_step_t::cov_t_t, DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, DCoordinateSystem::sdir, SPEED_OF_LIGHT, sqrt(), SYS_FCAL, SYS_TOF, DReferenceTrajectory::swim_step_t::t, DCoordinateSystem::tdir, and DCoordinateSystem::udir.
jerror_t DReferenceTrajectory::GetIntersectionWithRadius | ( | double | R, |
DVector3 & | mypos, | ||
double * | s = NULL , |
||
double * | t = NULL , |
||
DVector3 * | dir = NULL |
||
) | const |
Definition at line 893 of file DReferenceTrajectory.cc.
References _DBG_, alpha, DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, QuietNaN, DReferenceTrajectory::swim_step_t::s, SPEED_OF_LIGHT, sqrt(), and DReferenceTrajectory::swim_step_t::t.
Referenced by DParticleID::Distance_ToTrack(), JEventProcessor_BCAL_ADC_4ns::evnt(), MyProcessor::GetIntersectionWithCalorimeter(), and DParticleID::PredictBCALWedge().
|
inline |
Definition at line 137 of file DReferenceTrajectory.h.
References last_dist_along_wire.
Referenced by DTrackFitterALT1::FillDebugHists(), DEventProcessor_trackeff_hists2::FindLR(), DTrackFitterALT1::ForceLRTruth(), DTrackHitSelectorALT2::GetFDCHits(), and DTrackFitterALT1::GetResiInfo().
DVector3 DReferenceTrajectory::GetLastDOCAPoint | ( | void | ) | const |
Use values saved by the last call to one of the DistToRT functions to calculate the 3-D DOCA position in lab coordinates. This is mainly intended for debugging.
Definition at line 2317 of file DReferenceTrajectory.cc.
References QuietNaN, x, and y.
Referenced by DParticleID::Distance_ToTrack(), JEventProcessor_BCAL_ADC_4ns::evnt(), DEventProcessor_fdc_covariance_hists::evnt(), DEventProcessor_cdc_covariance_hists::evnt(), DEventProcessor_track_hists::evnt(), DEventProcessor_candidate_tree::evnt(), DEventProcessor_trackeff_hists2::FindLR(), DTrackFitterALT1::FitTrack(), DTrackFitterALT1::ForceLRTruth(), DTrackHitSelectorALT1::GetCDCHits(), DTrackHitSelectorALT2::GetCDCHits(), DTrackHitSelectorALT2::GetFDCHits(), and DTrackFitterALT1::GetHits().
Use values saved by the last call to one of the DistToRT functions to calculate the 3-D DOCA position in lab coordinates and momentum in GeV/c.
Definition at line 2280 of file DReferenceTrajectory.cc.
|
inline |
Definition at line 167 of file DReferenceTrajectory.h.
References last_swim_step.
Referenced by DEventProcessor_cdc_covariance_hists::evnt(), DEventProcessor_fdc_covariance_hists::evnt(), DTrackHitSelectorALT1::GetCDCHits(), DTrackHitSelectorALT2::GetCDCHits(), DTrackHitSelectorALT2::GetFDCHits(), and DTrackFitterALT1::GetResiInfo().
|
inline |
Definition at line 144 of file DReferenceTrajectory.h.
References mass.
Referenced by DReferenceTrajectory(), DTrackFitterALT1::DTrackFitterALT1(), DTrackFitterALT1::FillDebugHists(), DTrackHitSelectorALT1::GetCDCHits(), DTrackHitSelectorALT2::GetCDCHits(), DTrackHitSelectorALT1::GetFDCHits(), DTrackHitSelectorALT2::GetFDCHits(), DTrackFitterALT1::GetHits(), operator=(), and DParticleID::PredictSCSector().
|
inline |
Definition at line 153 of file DReferenceTrajectory.h.
References MAX_STEP_SIZE.
Referenced by DReferenceTrajectory(), and operator=().
|
inline |
Definition at line 152 of file DReferenceTrajectory.h.
References MIN_STEP_SIZE.
Referenced by DReferenceTrajectory(), and operator=().
|
inline |
Definition at line 150 of file DReferenceTrajectory.h.
References ploss_direction.
|
inline |
Definition at line 145 of file DReferenceTrajectory.h.
References step_size.
|
inline |
Definition at line 159 of file DReferenceTrajectory.h.
References zmax_track_boundary.
|
inline |
Definition at line 160 of file DReferenceTrajectory.h.
References zmin_track_boundary.
int DReferenceTrajectory::InsertSteps | ( | const swim_step_t * | start_step, |
double | delta_s, | ||
double | step_size = 0.02 |
||
) |
Insert additional steps into the reference trajectory starting at start_step and swimming for at least delta_s by step_size sized steps. Both delta_s and step_size are in centimeters. If the value of delta_s is negative then the particle's momentum and charge are reversed before swimming. This could be a problem if energy loss is implemented.
Definition at line 1167 of file DReferenceTrajectory.cc.
References xstream::base64::index(), DReferenceTrajectory::swim_step_t::itheta02, DReferenceTrajectory::swim_step_t::itheta02s, DReferenceTrajectory::swim_step_t::itheta02s2, DReferenceTrajectory::swim_step_t::mom, Nswim_steps, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::s, SetStepSize(), StepStruct::steps, Swim(), and swim_steps.
jerror_t DReferenceTrajectory::IntersectTracks | ( | const DReferenceTrajectory * | rt2, |
DKinematicData * | track1_kd, | ||
DKinematicData * | track2_kd, | ||
DVector3 & | pos, | ||
double & | doca, | ||
double & | var_doca, | ||
double & | vertex_chi2, | ||
bool | DoFitVertex = false |
||
) | const |
Definition at line 2689 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::B, DKinematicData::errorMatrix(), DMagneticFieldStepper::GetMomentum(), mass_sq, DReferenceTrajectory::swim_step_t::mom, Nswim_steps, DCoordinateSystem::origin, PropagateCovariance(), q, DReferenceTrajectory::swim_step_t::s, DKinematicData::setErrorMatrix(), DKinematicData::setMomentum(), DKinematicData::setPosition(), DKinematicData::setTime(), SPEED_OF_LIGHT, sqrt(), DMagneticFieldStepper::Step(), swim_steps, DReferenceTrajectory::swim_step_t::t, and DKinematicData::time().
DReferenceTrajectory & DReferenceTrajectory::operator= | ( | const DReferenceTrajectory & | rt | ) |
The assignment operator will always make sure the memory allocated for the swim_steps is owned by the object being copied into. If it already owns memory of sufficient size, then it will be reused. If it owns memory that is too small, it will be freed and a new block allocated. If it does not own its swim_steps coming in, then it will allocate memory so that it does own it on the way out.
Definition at line 140 of file DReferenceTrajectory.cc.
References bfield, dist_to_rt_depth, geom, GetBoundaryStepFraction(), GetCheckMaterialBoundaries(), GetMass(), GetMaxStepSize(), GetMinStepSize(), last_dist_along_wire, last_dz_dphi, last_phi, last_swim_step, max_swim_steps, MIN_STEP_SIZE, Nswim_steps, ploss_direction, q, RootGeom, step_size, and swim_steps.
jerror_t DReferenceTrajectory::PropagateCovariance | ( | double | ds, |
double | q, | ||
double | mass_sq, | ||
const DVector3 & | mom, | ||
const DVector3 & | pos, | ||
const DVector3 & | B, | ||
TMatrixFSym & | C | ||
) | const |
Definition at line 2459 of file DReferenceTrajectory.cc.
References py, SPEED_OF_LIGHT, sqrt(), and temp.
Referenced by IntersectTracks().
void DReferenceTrajectory::Reset | ( | void | ) |
Definition at line 225 of file DReferenceTrajectory.cc.
Referenced by DTrackTimeBased_factory_THROWN::evnt(), DTrackWireBased_factory_THROWN::evnt(), and DTrackCandidate_factory_THROWN::evnt().
|
inline |
Definition at line 148 of file DReferenceTrajectory.h.
References check_material_boundaries.
Referenced by DTrackFitterALT1::FitTrack().
|
inline |
Definition at line 163 of file DReferenceTrajectory.h.
References debug_level.
|
inline |
Definition at line 140 of file DReferenceTrajectory.h.
References geom.
Referenced by MyProcessor::AddKinematicDataTrack(), DTrackTimeBased_factory::CorrectForELoss(), DTrackFitter::CorrectForELoss(), DTrackFitterALT1::DTrackFitterALT1(), JEventProcessor_dumpcandidates::evnt(), DTrackTimeBased_factory_THROWN::evnt(), DTrackWireBased_factory_THROWN::evnt(), DEventSourceEVIO::Extract_DTrackTimeBased(), MyProcessor::GetDReferenceTrajectory(), and MyProcessor::GetIntersectionWithCalorimeter().
|
inline |
Definition at line 139 of file DReferenceTrajectory.h.
References RootGeom.
Referenced by MyProcessor::AddKinematicDataTrack(), DTrackFitterALT1::DTrackFitterALT1(), DTrackTimeBased_factory_THROWN::evnt(), DTrackWireBased_factory_THROWN::evnt(), DEventProcessor_fdc_covariance_hists::evnt(), DEventProcessor_cdc_covariance_hists::evnt(), MyProcessor::GetDReferenceTrajectory(), and MyProcessor::GetIntersectionWithCalorimeter().
|
inline |
Definition at line 146 of file DReferenceTrajectory.h.
Referenced by MyProcessor::AddKinematicDataTrack(), DTrackFitter::CorrectForELoss(), DTrackWireBased_factory::DoFit(), DTrackFitterALT1::DTrackFitterALT1(), JEventProcessor_dumpcandidates::evnt(), DTrackWireBased_factory_THROWN::evnt(), DTrackTimeBased_factory_THROWN::evnt(), DEventSourceEVIO::Extract_DTrackTimeBased(), DTrackFitterALT1::FitTrack(), MyProcessor::GetDReferenceTrajectory(), MyProcessor::GetIntersectionWithCalorimeter(), and DCustomAction_CutNoDetectorHit::Perform_Action().
|
inline |
Definition at line 147 of file DReferenceTrajectory.h.
References ploss_direction.
Referenced by DTrackFitter::CorrectForELoss(), and DTrackFitterALT1::FitTrack().
|
inline |
Definition at line 138 of file DReferenceTrajectory.h.
References step_size.
Referenced by InsertSteps().
|
inline |
Definition at line 157 of file DReferenceTrajectory.h.
References zmax, and zmax_track_boundary.
|
inline |
Definition at line 158 of file DReferenceTrajectory.h.
References zmin, and zmin_track_boundary.
|
inlinestatic |
Definition at line 86 of file DReferenceTrajectory.h.
Referenced by className().
double DReferenceTrajectory::Straw_dx | ( | const DCoordinateSystem * | wire, |
double | radius | ||
) | const |
Find the distance traveled within the specified radius of the specified wire. This will give the "dx" component of a dE/dx measurement for cylindrical geometry as we have with straw tubes.
At this point, the estimate is done using a simple linear extrapolation from the DOCA point in the direction of the momentum to the 2 points at which it itersects the given radius. Segments which extend past the end of the wire will be clipped to the end of the wire before calculating the total dx.
Definition at line 2203 of file DReferenceTrajectory.cc.
References c, DCoordinateSystem::L, DCoordinateSystem::origin, sqrt(), and DCoordinateSystem::udir.
Referenced by DEventProcessor_cdc_hists::evnt().
void DReferenceTrajectory::Swim | ( | const DVector3 & | pos, |
const DVector3 & | mom, | ||
double | q = -1000.0 , |
||
const TMatrixFSym * | cov = NULL , |
||
double | smax = 2000.0 , |
||
const DCoordinateSystem * | wire = NULL |
||
) |
(Re)Swim the trajectory starting from pos with momentum mom.
This will use the charge and step size (if given) passed to the constructor when the object was created. It will also (re)use the sim_step buffer, replacing it's contents.
Definition at line 611 of file DReferenceTrajectory.cc.
References DReferenceTrajectory::swim_step_t::B, DReferenceTrajectory::swim_step_t::cov_px_t, DReferenceTrajectory::swim_step_t::cov_py_t, DReferenceTrajectory::swim_step_t::cov_pz_t, DReferenceTrajectory::swim_step_t::cov_t_t, EPS, DMagneticFieldStepper::GetBField(), DMagneticFieldStepper::GetDirs(), DMagneticFieldStepper::GetPosMom(), DMagneticFieldStepper::GetRo(), DReferenceTrajectory::swim_step_t::invX0, DReferenceTrajectory::swim_step_t::itheta02, DReferenceTrajectory::swim_step_t::itheta02s, DReferenceTrajectory::swim_step_t::itheta02s2, MIN_STEP_SIZE, DReferenceTrajectory::swim_step_t::mom, DCoordinateSystem::origin, DReferenceTrajectory::swim_step_t::Ro, DReferenceTrajectory::swim_step_t::s, DCoordinateSystem::sdir, DMagneticFieldStepper::SetStartingParams(), DMagneticFieldStepper::SetStepSize(), SPEED_OF_LIGHT, sqrt(), DMagneticFieldStepper::Step(), DReferenceTrajectory::swim_step_t::t, DCoordinateSystem::tdir, DCoordinateSystem::udir, and X0.
Referenced by MyProcessor::AddKinematicDataTrack(), JEventProcessor_dumpcandidates::evnt(), DTrackWireBased_factory_THROWN::evnt(), DTrackTimeBased_factory_THROWN::evnt(), DEventProcessor_cdc_covariance_hists::evnt(), DEventProcessor_fdc_covariance_hists::evnt(), DTrackCandidate_factory_THROWN::evnt(), DEventProcessor_cdc_hists::evnt(), DEventProcessor_candidate_tree::evnt(), DEventSourceEVIO::Extract_DTrackTimeBased(), DTrackFitterALT1::FitTrack(), MyProcessor::GetDReferenceTrajectory(), MyProcessor::GetIntersectionWithCalorimeter(), DTrackFitterALT1::GetResiInfo(), InsertSteps(), and DCustomAction_CutNoDetectorHit::Perform_Action().
|
protected |
Definition at line 209 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetBfield(), and operator=().
|
protected |
Definition at line 225 of file DReferenceTrajectory.h.
Referenced by GetBoundaryStepFraction().
|
protected |
Definition at line 213 of file DReferenceTrajectory.h.
Referenced by GetCheckMaterialBoundaries(), and SetCheckMaterialBoundaries().
|
protected |
Definition at line 203 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetDebugLevel(), and SetDebugLevel().
|
protected |
Definition at line 207 of file DReferenceTrajectory.h.
Referenced by operator=().
|
staticprotected |
Definition at line 229 of file DReferenceTrajectory.h.
|
protected |
Definition at line 211 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetDGeometry(), operator=(), and SetDGeometry().
|
protected |
Definition at line 223 of file DReferenceTrajectory.h.
Referenced by GetHitCDCEndplate().
int DReferenceTrajectory::index_at_bcal |
Definition at line 197 of file DReferenceTrajectory.h.
int DReferenceTrajectory::index_at_fcal |
Definition at line 197 of file DReferenceTrajectory.h.
int DReferenceTrajectory::index_at_tof |
Definition at line 197 of file DReferenceTrajectory.h.
|
mutableprotected |
Definition at line 219 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetLastDistAlongWire(), and operator=().
|
mutableprotected |
Definition at line 220 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), and operator=().
|
mutableprotected |
last phi found in DistToRT
Definition at line 217 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), and operator=().
|
mutableprotected |
last swim step used in DistToRT
Definition at line 218 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetLastSwimStep(), and operator=().
|
protected |
Definition at line 222 of file DReferenceTrajectory.h.
|
protected |
Definition at line 222 of file DReferenceTrajectory.h.
Referenced by IntersectTracks(), and SetMass().
|
protected |
Definition at line 227 of file DReferenceTrajectory.h.
Referenced by GetMaxStepSize().
|
protected |
Definition at line 205 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), and operator=().
|
protected |
Definition at line 226 of file DReferenceTrajectory.h.
Referenced by GetMinStepSize().
int DReferenceTrajectory::Nswim_steps |
Definition at line 195 of file DReferenceTrajectory.h.
Referenced by MyProcessor::AddKinematicDataTrack(), DReferenceTrajectory(), DTrackHitSelectorTHROWN::FindTrackNumber(), DTrackFitterALT1::FitTrack(), DTrackFitterALT1::GetResiInfo(), InsertSteps(), IntersectTracks(), DTrackFitterALT1::LeastSquaresB(), operator=(), and DParticleID::PredictSCSector().
|
protected |
Definition at line 206 of file DReferenceTrajectory.h.
|
protected |
Definition at line 212 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetPLossDirection(), operator=(), and SetPLossDirection().
float DReferenceTrajectory::q |
Definition at line 196 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), JEventProcessor_dumpcandidates::evnt(), DTrackTimeBased_factory_THROWN::evnt(), DTrackWireBased_factory_THROWN::evnt(), DTrackCandidate_factory_THROWN::evnt(), DTrackFitterALT1::FitTrack(), DTrackHitSelectorALT2::GetCDCHits(), DTrackHitSelectorALT2::GetFDCHits(), IntersectTracks(), DTrackFitterALT1::LeastSquaresB(), operator=(), DCustomAction_CutNoDetectorHit::Perform_Action(), and DParticleID::PredictSCSector().
|
protected |
Definition at line 210 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetDRootGeom(), operator=(), and SetDRootGeom().
double DReferenceTrajectory::Rsqmax_exterior |
Definition at line 199 of file DReferenceTrajectory.h.
Referenced by MyProcessor::AddKinematicDataTrack(), MyProcessor::GetDReferenceTrajectory(), and MyProcessor::GetIntersectionWithCalorimeter().
double DReferenceTrajectory::Rsqmax_interior |
Definition at line 198 of file DReferenceTrajectory.h.
Referenced by MyProcessor::AddKinematicDataTrack(), MyProcessor::GetDReferenceTrajectory(), and MyProcessor::GetIntersectionWithCalorimeter().
|
protected |
Definition at line 208 of file DReferenceTrajectory.h.
Referenced by DReferenceTrajectory(), GetStepSize(), operator=(), and SetStepSize().
swim_step_t* DReferenceTrajectory::swim_steps |
Definition at line 194 of file DReferenceTrajectory.h.
Referenced by MyProcessor::AddKinematicDataTrack(), DParticleID::Distance_ToTrack(), DReferenceTrajectory(), DTrackHitSelectorTHROWN::FindTrackNumber(), DTrackFitterALT1::FitTrack(), DParticleID::Get_ClosestToTrack(), DTrackHitSelectorALT1::GetCDCHits(), DTrackHitSelectorALT2::GetCDCHits(), DTrackHitSelectorALT1::GetFDCHits(), DTrackHitSelectorALT2::GetFDCHits(), InsertSteps(), IntersectTracks(), DTrackFitterALT1::LeastSquaresB(), operator=(), and DParticleID::PredictSCSector().
|
protected |
Definition at line 215 of file DReferenceTrajectory.h.
Referenced by GetZmaxTrackingBoundary(), and SetZmaxTrackingBoundary().
|
protected |
Definition at line 214 of file DReferenceTrajectory.h.
Referenced by GetZminTrackingBoundary(), and SetZminTrackingBoundary().