hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
Loading...
Searching...
No Matches
utils Namespace Reference

Functions

bool hasCollection (EVENT::LCEvent *lc_event, const std::string &collection)
 description
Vertex * buildVertex (EVENT::Vertex *lc_vertex)
 description
Particle * buildParticle (EVENT::ReconstructedParticle *lc_particle, std::string trackstate_location, EVENT::LCCollection *gbl_kink_data, EVENT::LCCollection *track_data)
 description
Track * buildTrack (EVENT::Track *lc_track, std::string trackstate_location, EVENT::LCCollection *gbl_kink_data, EVENT::LCCollection *track_data)
 description
bool IsSameTrack (Track *trk1, Track *trk2)
 description
RawSvtHit * buildRawHit (EVENT::TrackerRawData *rawTracker_hit, EVENT::LCCollection *raw_svt_hit_fits)
TrackerHit * buildTrackerHit (IMPL::TrackerHitImpl *lc_trackerHit, bool rotate=true, int type=0)
 description
CalCluster * buildCalCluster (EVENT::Cluster *lc_cluster)
 description
bool addRawInfoTo3dHit (TrackerHit *tracker_hit, IMPL::TrackerHitImpl *lc_tracker_hit, EVENT::LCCollection *raw_svt_fits, std::vector< RawSvtHit * > *rawHits=nullptr, int type=0, bool storeRawHit=true)
 description
bool isUsedByTrack (IMPL::TrackerHitImpl *lc_tracker_hit, EVENT::Track *lc_track)
 description
bool isUsedByTrack (TrackerHit *tracker_hit, EVENT::Track *lc_track)
 description
bool getParticlesFromVertex (Vertex *vtx, Particle *ele, Particle *pos)
 description
static UTIL::BitField64 decoder ("system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12")
 description
double getKalmanTrackL1Isolations (Track *track, std::vector< TrackerHit * > *siClusters)
 description
void get2016KFMCTruthHitCodes (Track *ele_trk, Track *pos_trk, int &L1L2hitCode, int &L1hitCode, int &L2hitCode)
 description
double v0_projection_to_target_significance (json v0proj_fits, int run, double &vtx_proj_x, double &vtx_proj_y, double &vtx_proj_x_signif, double &vtx_proj_y_signif, double &vtx_proj_x_centered, double &vtx_proj_y_centered, double vtx_x, double vtx_y, double vtx_z, double vtx_px, double vtx_py, double vtx_pz, bool debug=false)
 description
double v0_projection_to_target_significance (json v0proj_fits, int run, double &vtx_proj_x, double &vtx_proj_y, double &vtx_proj_x_signif, double &vtx_proj_y_signif, Vertex *vtx, double &vtx_proj_x_err, double &vtx_proj_y_err, double &vtx_proj_x_centered, double &vtx_proj_y_centered, bool debug=false)
void debug_target_projection (double target_pos, Vertex *vtx)
int getTruthPDG (Track &trk, const std::vector< MCParticle * > *mcParticles, bool debug=false)
 Get the PDG code of the truth particle best matching this track.
bool hasTruthMatch (Track &trk, const std::vector< MCParticle * > *mcParticles, bool debug=false)
 Check if a track has a truth-matched electron/positron.

Function Documentation

◆ addRawInfoTo3dHit()

bool addRawInfoTo3dHit ( TrackerHit * tracker_hit,
IMPL::TrackerHitImpl * lc_tracker_hit,
EVENT::LCCollection * raw_svt_fits,
std::vector< RawSvtHit * > * rawHits = nullptr,
int type = 0,
bool storeRawHit = true )

description

Parameters
tracker_hit
lc_tracker_hit
raw_svt_fits
rawHits
type
Returns
true
false

Definition at line 457 of file utilities.cxx.

◆ buildCalCluster()

CalCluster * buildCalCluster ( EVENT::Cluster * lc_cluster)

description

Parameters
lc_cluster
Returns
CalCluster*

Definition at line 95 of file utilities.cxx.

◆ buildParticle()

Particle * buildParticle ( EVENT::ReconstructedParticle * lc_particle,
std::string trackstate_location,
EVENT::LCCollection * gbl_kink_data,
EVENT::LCCollection * track_data )

description

Parameters
lc_particle
gbl_kink_data
track_data
Returns
Particle*

Definition at line 47 of file utilities.cxx.

◆ buildRawHit()

RawSvtHit * buildRawHit ( EVENT::TrackerRawData * rawTracker_hit,
EVENT::LCCollection * raw_svt_hit_fits )

Definition at line 374 of file utilities.cxx.

◆ buildTrack()

Track * buildTrack ( EVENT::Track * lc_track,
std::string trackstate_location,
EVENT::LCCollection * gbl_kink_data,
EVENT::LCCollection * track_data )

description

Parameters
lc_track
gbl_kink_data
track_data
Returns
Track*

Definition at line 138 of file utilities.cxx.

◆ buildTrackerHit()

TrackerHit * buildTrackerHit ( IMPL::TrackerHitImpl * lc_trackerHit,
bool rotate = true,
int type = 0 )

description

Parameters
lc_trackerHit
rotate
type
Returns
TrackerHit*

Definition at line 427 of file utilities.cxx.

◆ buildVertex()

Vertex * buildVertex ( EVENT::Vertex * lc_vertex)

description

Parameters
lc_vertex
Returns
Vertex*

Definition at line 27 of file utilities.cxx.

◆ debug_target_projection()

void debug_target_projection ( double target_pos,
Vertex * vtx )

Definition at line 1027 of file utilities.cxx.

◆ decoder()

UTIL::BitField64 decoder ( "system:6 ,
barrel:3 ,
layer:4 ,
module:12 ,
sensor:1 ,
side:32:- 2,
strip:12"  )
static

description

Todo
extern?

◆ get2016KFMCTruthHitCodes()

void get2016KFMCTruthHitCodes ( Track * ele_trk,
Track * pos_trk,
int & L1L2hitCode,
int & L1hitCode,
int & L2hitCode )

description

Todo
extern?

Definition at line 663 of file utilities.cxx.

◆ getKalmanTrackL1Isolations()

double getKalmanTrackL1Isolations ( Track * track,
std::vector< TrackerHit * > * siClusters )

description

Todo
extern?

Definition at line 568 of file utilities.cxx.

◆ getParticlesFromVertex()

bool getParticlesFromVertex ( Vertex * vtx,
Particle * ele,
Particle * pos )

description

Parameters
vtx
ele
pos
Returns
true
false

Definition at line 545 of file utilities.cxx.

◆ getTruthPDG()

int getTruthPDG ( Track & trk,
const std::vector< MCParticle * > * mcParticles,
bool debug = false )
inline

Get the PDG code of the truth particle best matching this track.

Finds the MC particle with the most hits on the track using two methods:

  1. getMcpHits() from Track (populated by VertexProcessor)
  2. getSvtHits() and getMCPartIDs() from TrackerHits (fallback)
Parameters
trkThe track to match
mcParticlesPointer to the MC particle collection
debugEnable debug output
Returns
PDG code of best-matching particle, or 0 if no match found

Definition at line 27 of file TruthMatchingUtils.h.

◆ hasCollection()

bool hasCollection ( EVENT::LCEvent * lc_event,
const std::string & collection )

description

Parameters
lc_event
collection
Returns
true
false

Definition at line 18 of file utilities.cxx.

◆ hasTruthMatch()

bool hasTruthMatch ( Track & trk,
const std::vector< MCParticle * > * mcParticles,
bool debug = false )
inline

Check if a track has a truth-matched electron/positron.

Parameters
trkThe track to check
mcParticlesPointer to the MC particle collection
debugEnable debug output
Returns
true if track matches an electron or positron (abs(PDG) == 11)

Definition at line 113 of file TruthMatchingUtils.h.

◆ IsSameTrack()

bool IsSameTrack ( Track * trk1,
Track * trk2 )

description

Parameters
trk1
trk2
Returns
true
false

Definition at line 128 of file utilities.cxx.

◆ isUsedByTrack() [1/2]

bool isUsedByTrack ( IMPL::TrackerHitImpl * lc_tracker_hit,
EVENT::Track * lc_track )

description

Parameters
lc_tracker_hit
lc_track
Returns
true
false

Definition at line 526 of file utilities.cxx.

◆ isUsedByTrack() [2/2]

bool isUsedByTrack ( TrackerHit * tracker_hit,
EVENT::Track * lc_track )

description

Parameters
tracker_hit
lc_track
Returns
true
false

Definition at line 536 of file utilities.cxx.

◆ v0_projection_to_target_significance() [1/2]

double v0_projection_to_target_significance ( json v0proj_fits,
int run,
double & vtx_proj_x,
double & vtx_proj_y,
double & vtx_proj_x_signif,
double & vtx_proj_y_signif,
double & vtx_proj_x_centered,
double & vtx_proj_y_centered,
double vtx_x,
double vtx_y,
double vtx_z,
double vtx_px,
double vtx_py,
double vtx_pz,
bool debug = false )

description

Todo
extern?

Definition at line 843 of file utilities.cxx.

◆ v0_projection_to_target_significance() [2/2]

double v0_projection_to_target_significance ( json v0proj_fits,
int run,
double & vtx_proj_x,
double & vtx_proj_y,
double & vtx_proj_x_signif,
double & vtx_proj_y_signif,
Vertex * vtx,
double & vtx_proj_x_err,
double & vtx_proj_y_err,
double & vtx_proj_x_centered,
double & vtx_proj_y_centered,
bool debug = false )

Definition at line 937 of file utilities.cxx.