Class Reference for E1039 Core & Analysis Software
UtilTrack Namespace Reference

Functions

SQTrackFindTrackByID (const SQTrackVector *vec, const int id_trk, const bool do_assert=false)
 Find a track by track ID in the given track list. More...
 
SQHitVectorFindHitsOfTrack (const SQHitVector *vec_in, const int id_trk)
 Find all hits associated with the given track. More...
 
SQHitVectorFindDetectorHitsOfTrack (const SQHitVector *vec_in, const int id_trk, const std::string det_name)
 Find track-associated hits whose detector name starts with 'det_name'. More...
 
SQHitVectorFindDetectorHitsOfTrack (const SQHitVector *vec_in, const int id_trk, const char *det_name)
 Find track-associated hits whose detector name starts with 'det_name'. More...
 
SQHitVectorFindHodoHitsOfTrack (const SQHitVector *vec_in, const int id_trk)
 Find all hodoscope hits hits associated with the given track. More...
 
std::vector< int > FindMatchedRoads (SRecTrack *trk, const double margin=0)
 Find all roads that match to the given track within the hodo paddle width plus the given margin. More...
 
std::vector< int > FindMatchedRoads (const TVector3 pos1, const TLorentzVector mom1, const TVector3 pos3, const TLorentzVector mom3, const double margin=0)
 Find all roads that match to the given track within the hodo paddle width plus the given margin. More...
 

Variables

int verbosity = 0
 

Function Documentation

◆ FindDetectorHitsOfTrack() [1/2]

SQHitVector * UtilTrack::FindDetectorHitsOfTrack ( const SQHitVector vec_in,
const int  id_trk,
const char *  det_name 
)

Find track-associated hits whose detector name starts with 'det_name'.

Definition at line 71 of file UtilTrack.cc.

References FindDetectorHitsOfTrack().

+ Here is the call graph for this function:

◆ FindDetectorHitsOfTrack() [2/2]

SQHitVector * UtilTrack::FindDetectorHitsOfTrack ( const SQHitVector vec_in,
const int  id_trk,
const std::string  det_name 
)

Find track-associated hits whose detector name starts with 'det_name'.

Examples:

shared_ptr<SQHitVector> hit_vec_trk_d0(UtilTrack::FindDetectorHitsOfTrack(hit_vec, id_trk, "D0"));
SQHitVector * FindDetectorHitsOfTrack(const SQHitVector *vec_in, const int id_trk, const std::string det_name)
Find track-associated hits whose detector name starts with 'det_name'.
Definition: UtilTrack.cc:56

You can use "FindHodoHitsOfTrack()" to more-conveniently find all hodoscope hits.

Definition at line 56 of file UtilTrack.cc.

References SQHitVector::begin(), SQHitVector::clear(), SQHitVector::Clone(), SQHitVector::end(), SQHit::get_detector_id(), SQHit::get_track_id(), GeomSvc::getDetectorName(), GeomSvc::instance(), and SQHitVector::push_back().

Referenced by FindDetectorHitsOfTrack(), and FindHodoHitsOfTrack().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindHitsOfTrack()

SQHitVector * UtilTrack::FindHitsOfTrack ( const SQHitVector vec_in,
const int  id_trk 
)

Find all hits associated with the given track.

It is recommended to receive the returned pointer by "shared_ptr".

shared_ptr<SQHitVector> hit_vec_trk(UtilTrack::FindHitsOfTrack(hit_vec, id_trk));
SQHitVector * FindHitsOfTrack(const SQHitVector *vec_in, const int id_trk)
Find all hits associated with the given track.
Definition: UtilTrack.cc:36

Definition at line 36 of file UtilTrack.cc.

References SQHitVector::begin(), SQHitVector::clear(), SQHitVector::Clone(), SQHitVector::end(), SQHit::get_track_id(), and SQHitVector::push_back().

+ Here is the call graph for this function:

◆ FindHodoHitsOfTrack()

SQHitVector * UtilTrack::FindHodoHitsOfTrack ( const SQHitVector vec_in,
const int  id_trk 
)

Find all hodoscope hits hits associated with the given track.

Example:

shared_ptr<SQHitVector> hit_vec_trk(UtilTrack::FindHodoHitsOfTrack(hit_vec, id_trk));
SQHitVector * FindHodoHitsOfTrack(const SQHitVector *vec_in, const int id_trk)
Find all hodoscope hits hits associated with the given track.
Definition: UtilTrack.cc:83

Definition at line 83 of file UtilTrack.cc.

References FindDetectorHitsOfTrack().

Referenced by SubsysRecoSignal::process_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FindMatchedRoads() [1/2]

std::vector< int > UtilTrack::FindMatchedRoads ( const TVector3  pos1,
const TLorentzVector  mom1,
const TVector3  pos3,
const TLorentzVector  mom3,
const double  margin = 0 
)

Find all roads that match to the given track within the hodo paddle width plus the given margin.

Check three elements, assuming the margin is much smaller than the half width.

Definition at line 105 of file UtilTrack.cc.

References Plane::cellWidth, Plane::deltaX, Plane::deltaZ, GeomSvc::getDetectorID(), GeomSvc::getPlanePtr(), UtilTrigger::Hodo2Road(), GeomSvc::instance(), Plane::nElements, Plane::spacing, verbosity, Plane::xc, and Plane::zc.

+ Here is the call graph for this function:

◆ FindMatchedRoads() [2/2]

std::vector< int > UtilTrack::FindMatchedRoads ( SRecTrack trk,
const double  margin = 0 
)

Find all roads that match to the given track within the hodo paddle width plus the given margin.

The closest paddle to the given track at each hodoscope X plane (H1T/B, H2T/B, H3T/B and H4T/B) is selected based on the expected track x-position. The two adjacent paddles are also selected if they are within "width/2 + margin". All selected paddles are used to list up matched roads.

SRecTrack* trk = ...
const double margin = 1.0; // in cm
vector<int> list_road_id = UtilTrack::FindMatchedRoad(trk, margin);

Definition at line 99 of file UtilTrack.cc.

References SRecTrack::get_mom_st1(), SRecTrack::get_mom_st3(), SRecTrack::get_pos_st1(), and SRecTrack::get_pos_st3().

+ Here is the call graph for this function:

◆ FindTrackByID()

SQTrack * UtilTrack::FindTrackByID ( const SQTrackVector vec,
const int  id_trk,
const bool  do_assert = false 
)

Find a track by track ID in the given track list.

This function returns a SQTrack pointer if successful. Otherwise it returns '0' by default, or aborts when 'do_assert' = true.

Definition at line 17 of file UtilTrack.cc.

References SQTrackVector::begin(), SQTrackVector::end(), and SQTrack::get_track_id().

Referenced by SubsysRecoSignal::process_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ verbosity