CMS 3D CMS Logo

Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
mkfit Namespace Reference

Namespaces

 Config
 
 Const
 
 internal
 
 mini_propagators
 
 StdSeq
 

Classes

struct  axis
 
struct  axis_base
 
struct  axis_pow2
 
struct  axis_pow2_base
 
struct  axis_pow2_u1
 
struct  BeamSpot
 
struct  binnor
 
class  CandCloner
 
class  CcAlloc
 
class  CcPool
 
class  CombCandidate
 
class  ConfigJson
 
class  ConfigJsonPatcher
 
struct  DataFile
 
struct  DataFileHeader
 
struct  DeadRegion
 
class  Event
 
class  EventOfCombCandidates
 
class  EventOfHits
 
struct  ExecutionContext
 
class  FindingFoos
 
struct  FitVal
 
class  Hit
 
struct  HitMatch
 
struct  HitMatchPair
 
struct  HitOnTrack
 
struct  HoTNode
 
struct  IdxChi2List
 
class  IterationConfig
 
class  IterationLayerConfig
 
struct  IterationMaskIfc
 
struct  IterationMaskIfcBase
 
struct  IterationMaskIfcCmssw
 
class  IterationParams
 
class  IterationSeedPartition
 
class  IterationsInfo
 
struct  LayerControl
 
class  LayerInfo
 
class  LayerNumberConverter
 
class  LayerOfHits
 
class  MatriplexErrParPackerSlurpIn
 
class  MatriplexPackerSlurpIn
 
class  MatriplexTrackPackerPlexify
 
struct  MCHitInfo
 
struct  MeasurementState
 
class  MkBase
 
class  MkBuilder
 
class  MkBuilderWrapper
 
class  MkFinder
 
class  MkFitter
 
class  MkJob
 
struct  ModuleInfo
 
class  Pool
 
class  PropagationConfig
 
class  PropagationFlags
 
class  radix_sort
 
class  rectvec
 
struct  ReducedTrack
 
class  Shell
 
struct  sortTracksByPhiStruct
 
class  SteeringParams
 
class  Track
 
class  TrackBase
 
class  TrackCand
 
class  TrackerInfo
 
class  TrackExtra
 
struct  TrackState
 
class  TTreeValidation
 
struct  UpdateIndices
 
class  Validation
 
struct  WSR_Result
 

Typedefs

using clean_duplicates_cf = void(TrackVec &, const IterationConfig &)
 
using clean_duplicates_func = std::function< clean_duplicates_cf >
 
using clean_seeds_cf = int(TrackVec &, const IterationConfig &, const BeamSpot &)
 
using clean_seeds_func = std::function< clean_seeds_cf >
 
typedef std::map< std::string, std::pair< cleanOpts, std::string > > cleanOptsMap
 
typedef std::vector< DeadRegionDeadVec
 
typedef std::vector< EventEventVec
 
using filter_candidates_cf = bool(const TrackCand &, const MkJob &)
 
using filter_candidates_func = std::function< filter_candidates_cf >
 
typedef std::map< int, FitValFitValLayMap
 
typedef std::vector< std::pair< int, float > > FltLayerPairVec
 
typedef std::vector< int > HitIdxVec
 
typedef std::map< int, std::vector< int > > HitLayerMap
 
using HitVec = std::vector< Hit >
 
typedef std::vector< HitOnTrackHoTVec
 
typedef std::pair< int, float > idchi2Pair
 
typedef std::vector< idchi2Pairidchi2PairVec
 
typedef std::map< int, std::map< int, std::vector< int > > > LayIdxIDVecMapMap
 
typedef std::map< std::string, std::pair< matchOpts, std::string > > matchOptsMap
 
using MatriplexHitPacker = MatriplexErrParPackerSlurpIn< Hit, float >
 
using MatriplexHoTPacker = MatriplexPackerSlurpIn< HitOnTrack >
 
using MatriplexTrackPacker = MatriplexErrParPackerSlurpIn< TrackBase, float >
 
typedef std::vector< MCHitInfoMCHitInfoVec
 
typedef Matriplex::Matriplex< float, 2, 2, NNMPlex22
 
typedef Matriplex::Matriplex< float, 2, HH, NNMPlex2H
 
typedef Matriplex::MatriplexSym< float, 2, NNMPlex2S
 
typedef Matriplex::Matriplex< float, 2, 1, NNMPlex2V
 
typedef Matriplex::Matriplex< float, 5, 5, NNMPlex55
 
typedef Matriplex::Matriplex< float, 5, 6, NNMPlex56
 
typedef Matriplex::Matriplex< float, 6, 5, NNMPlex65
 
typedef Matriplex::Matriplex< float, HH, 2, NNMPlexH2
 
typedef Matriplex::Matriplex< float, HH, HH, NNMPlexHH
 
using MPlexHitIdx = Matriplex::Matriplex< int, MPlexHitIdxMax, 1, NN >
 
typedef Matriplex::Matriplex< float, HH, LL, NNMPlexHL
 
typedef Matriplex::MatriplexSym< float, HH, NNMPlexHS
 
typedef Matriplex::Matriplex< float, HH, 1, NNMPlexHV
 
typedef Matriplex::Matriplex< float, LL, 2, NNMPlexL2
 
typedef Matriplex::Matriplex< float, LL, HH, NNMPlexLH
 
typedef Matriplex::Matriplex< float, LL, LL, NNMPlexLL
 
typedef Matriplex::MatriplexSym< float, LL, NNMPlexLS
 
typedef Matriplex::Matriplex< float, LL, 1, NNMPlexLV
 
typedef Matriplex::Matriplex< bool, 1, 1, NNMPlexQB
 
typedef Matriplex::Matriplex< float, 1, 1, NNMPlexQF
 
typedef Matriplex::Matriplex< short, 1, 1, NNMPlexQH
 
using MPlexQHoT = Matriplex::Matriplex< HitOnTrack, 1, 1, NN >
 
typedef Matriplex::Matriplex< int, 1, 1, NNMPlexQI
 
typedef Matriplex::Matriplex< unsigned short, 1, 1, NNMPlexQUH
 
typedef Matriplex::Matriplex< unsigned int, 1, 1, NNMPlexQUI
 
typedef std::array< int, 2 > PairIdx
 
typedef std::vector< PairIdxPairIdxVec
 
using partition_seeds_cf = void(const TrackerInfo &, const TrackVec &, const EventOfHits &, IterationSeedPartition &)
 
using partition_seeds_func = std::function< partition_seeds_cf >
 
typedef std::vector< ReducedTrackRedTrackVec
 
typedef std::map< std::string, std::pair< seedOpts, std::string > > seedOptsMap
 
typedef std::pair< int, int > SimTkIDInfo
 
typedef ROOT::Math::SMatrix< float, 2 > SMatrix22
 
typedef ROOT::Math::SMatrix< float, 2, 6 > SMatrix26
 
typedef ROOT::Math::SMatrix< float, 3 > SMatrix33
 
typedef ROOT::Math::SMatrix< float, 3, 6 > SMatrix36
 
typedef ROOT::Math::SMatrix< float, 6, 2 > SMatrix62
 
typedef ROOT::Math::SMatrix< float, 6, 3 > SMatrix63
 
typedef ROOT::Math::SMatrix< float, 6 > SMatrix66
 
typedef ROOT::Math::SMatrix< float, 2, 2, ROOT::Math::MatRepSym< float, 2 > > SMatrixSym22
 
typedef ROOT::Math::SMatrix< float, 3, 3, ROOT::Math::MatRepSym< float, 3 > > SMatrixSym33
 
typedef ROOT::Math::SMatrix< float, 6, 6, ROOT::Math::MatRepSym< float, 6 > > SMatrixSym66
 
typedef ROOT::Math::SVector< float, 2 > SVector2
 
typedef ROOT::Math::SVector< float, 3 > SVector3
 
typedef ROOT::Math::SVector< float, 6 > SVector6
 
typedef std::unordered_map< int, FitValLayMapTkIDtoFitValLayMapMap
 
typedef std::unordered_map< int, int > TkIDToTkIDMap
 
typedef std::unordered_map< int, std::vector< int > > TkIDToTkIDVecMap
 
typedef std::unordered_map< int, TSLayerPairVecTkIDToTSLayerPairVecMap
 
typedef std::unordered_map< int, TrackStateTkIDToTSMap
 
typedef std::vector< TSVecTkIDToTSVecVec
 
using track_score_cf = float(const int nfoundhits, const int ntailholes, const int noverlaphits, const int nmisshits, const float chi2, const float pt, const bool inFindCandidates)
 
using track_score_func = std::function< track_score_cf >
 
typedef std::vector< TrackExtraTrackExtraVec
 
using TrackVec = std::vector< Track >
 
typedef std::vector< TrackVecTrackVecVec
 
typedef std::array< int, 3 > TripletIdx
 
typedef std::vector< TripletIdxTripletIdxVec
 
typedef std::map< int, std::unordered_set< int > > TrkIDLaySetMap
 
typedef std::vector< std::pair< int, TrackState > > TSLayerPairVec
 
typedef std::vector< TrackStateTSVec
 

Enumerations

enum  cleanOpts { noCleaning, cleanSeedsN2, cleanSeedsPure, cleanSeedsBadLabel }
 
enum  KalmanFilterOperation { KFO_Calculate_Chi2 = 1, KFO_Update_Params = 2, KFO_Local_Cov = 4 }
 
enum  matchOpts { trkParamBased, hitBased, labelBased }
 
enum  PropagationFlagsEnum { PF_none = 0, PF_use_param_b_field = 0x1, PF_apply_material = 0x2, PF_copy_input_state_on_fail = 0x4 }
 
enum  seedOpts { simSeeds, cmsswSeeds, findSeeds }
 
enum  TkLayout { TkLayout::phase0 = 0, TkLayout::phase1 = 1, TkLayout::phase2 = 2 }
 
enum  WithinSensitiveRegion_e {
  WSR_Undef = -1, WSR_Inside = 0, WSR_Edge, WSR_Outside,
  WSR_Failed
}
 

Functions

void applyMaterialEffects (const MPlexQF &hitsRl, const MPlexQF &hitsXi, const MPlexQF &propSign, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
 
int calculateCharge (const Hit &hit0, const Hit &hit1, const Hit &hit2)
 
int calculateCharge (const float hit0_x, const float hit0_y, const float hit1_x, const float hit1_y, const float hit2_x, const float hit2_y)
 
float cdist (float a)
 
void CFMap (const MPlexHH &A, const MPlexHV &B, MPlexHV &C)
 
template<typename Vector , typename Matrix >
float computeHelixChi2 (const Vector &simV, const Vector &recoV, const Matrix &recoM, const bool diagOnly=false)
 
void conformalFitMPlex (bool fitting, MPlexQI seedID, MPlexLS &outErr, MPlexLV &outPar, const MPlexHV &msPar0, const MPlexHV &msPar1, const MPlexHV &msPar2)
 
template<typename Traits , typename HitCollection >
edm::ProductID convertHits (const Traits &traits, const HitCollection &hits, mkfit::HitVec &mkFitHits, std::vector< TrackingRecHit const *> &clusterIndexToHit, std::vector< float > &clusterChargeVec, const TrackerTopology &ttopo, const TransientTrackingRecHitBuilder &ttrhBuilder, const MkFitGeometry &mkFitGeom)
 
template<typename T >
T cube (T x)
 
template<typename Matrix >
void diagonalOnly (Matrix &m)
 
double dtime ()
 
template<typename Matrix >
void dumpMatrix (Matrix m)
 
SimSeedInfo evsi2ssinfo (const Event *ev, int seed_idx)
 
void execTrackerInfoCreatorPlugin (const std::string &base, TrackerInfo &ti, IterationsInfo &ii, bool verbose)
 
void findSeedsByRoadSearch (TripletIdxConVec &seed_idcs, std::vector< LayerOfHits > &evt_lay_hits, int lay1_size, Event *&ev)
 
void from_json (const nlohmann::json &nlohmann_json_j, mkfit::LayerControl &nlohmann_json_t)
 
void from_json (const nlohmann::ordered_json &nlohmann_json_j, mkfit::LayerControl &nlohmann_json_t)
 
void from_json (const nlohmann::json &nlohmann_json_j, mkfit::SteeringParams &nlohmann_json_t)
 
void from_json (const nlohmann::ordered_json &nlohmann_json_j, mkfit::SteeringParams &nlohmann_json_t)
 
void from_json (const nlohmann::json &nlohmann_json_j, mkfit::IterationLayerConfig &nlohmann_json_t)
 
void from_json (const nlohmann::ordered_json &nlohmann_json_j, mkfit::IterationLayerConfig &nlohmann_json_t)
 
void from_json (const nlohmann::json &nlohmann_json_j, mkfit::IterationParams &nlohmann_json_t)
 
void from_json (const nlohmann::ordered_json &nlohmann_json_j, mkfit::IterationParams &nlohmann_json_t)
 
void from_json (const nlohmann::json &nlohmann_json_j, mkfit::IterationConfig &nlohmann_json_t)
 
void from_json (const nlohmann::ordered_json &nlohmann_json_j, mkfit::IterationConfig &nlohmann_json_t)
 
void from_json (const nlohmann::json &nlohmann_json_j, mkfit::IterationsInfo &nlohmann_json_t)
 
void from_json (const nlohmann::ordered_json &nlohmann_json_j, mkfit::IterationsInfo &nlohmann_json_t)
 
float getEta (float r, float z)
 
float getEta (float theta)
 
float getEta (float x, float y, float z)
 
float getEtaErr2 (float x, float y, float z, float exx, float eyy, float ezz, float exy, float exz, float eyz)
 
float getHypot (float x, float y)
 
float getInvRad2 (float x, float y)
 
float getInvRadErr2 (float x, float y, float exx, float eyy, float exy)
 
int getMatchBin (const float pt)
 
float getPhi (float x, float y)
 
float getPhiErr2 (float x, float y, float exx, float eyy, float exy)
 
float getPxPxErr2 (float ipt, float phi, float vipt, float vphi)
 
float getPyPyErr2 (float ipt, float phi, float vipt, float vphi)
 
float getPzPzErr2 (float ipt, float theta, float vipt, float vtheta)
 
float getRad2 (float x, float y)
 
float getRadErr2 (float x, float y, float exx, float eyy, float exy)
 
float getScoreCand (const track_score_func &score_func, const TrackCand &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
 
float getScoreCand (const track_score_func &score_func, const Track &cand1, bool penalizeTailMissHits=false, bool inFindCandidates=false)
 
float getScoreStruct (const track_score_func &score_func, const IdxChi2List &cand1)
 
float getScoreWorstPossible ()
 
float getTheta (float r, float z)
 
float getThetaErr2 (float x, float y, float z, float exx, float eyy, float ezz, float exy, float exz, float eyz)
 
void helixAtPlane (const MPlexLV &inPar, const MPlexQI &inChg, const MPlexHV &plPnt, const MPlexHV &plNrm, MPlexQF &pathL, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
 
void helixAtRFromIterativeCCS (const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
 
void helixAtRFromIterativeCCSFullJac (const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc)
 
void helixAtRFromIterativeCCSFullJac (const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLV &outPar, MPlexLL &errorProp, const int N_proc)
 
void helixAtZ (const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
 
float hipo (float x, float y)
 
float hipo_sqr (float x, float y)
 
RVec hit2pos (const Hit &h)
 
void intersectThirdLayer (const float a, const float b, const float hit1_x, const float hit1_y, float &lay2_x, float &lay2_y)
 
constexpr bool isFinite (float x)
 
bool isStripQCompatible (int itrack, bool isBarrel, const MPlexLS &pErr, const MPlexLV &pPar, const MPlexHS &msErr, const MPlexHV &msPar)
 
void kalmanComputeChi2 (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexQI &inChg, const MPlexHS &msErr, const MPlexHV &msPar, MPlexQF &outChi2, const int N_proc)
 
void kalmanComputeChi2Endcap (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexQI &inChg, const MPlexHS &msErr, const MPlexHV &msPar, MPlexQF &outChi2, const int N_proc)
 
void kalmanComputeChi2Plane (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexQI &inChg, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexQF &outChi2, const int N_proc)
 
void kalmanOperation (const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
 
void kalmanOperationEndcap (const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
 
void kalmanOperationPlane (const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
 
void kalmanPropagateAndComputeChi2 (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexQI &inChg, const MPlexHS &msErr, const MPlexHV &msPar, MPlexQF &outChi2, MPlexLV &propPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &propFlags, const bool propToHit)
 
void kalmanPropagateAndComputeChi2Endcap (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexQI &inChg, const MPlexHS &msErr, const MPlexHV &msPar, MPlexQF &outChi2, MPlexLV &propPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &propFlags, const bool propToHit)
 
void kalmanPropagateAndComputeChi2Plane (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexQI &inChg, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexQF &outChi2, MPlexLV &propPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &propFlags, const bool propToHit)
 
void kalmanPropagateAndUpdate (const MPlexLS &psErr, const MPlexLV &psPar, MPlexQI &Chg, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &propFlags, const bool propToHit)
 
void kalmanPropagateAndUpdateEndcap (const MPlexLS &psErr, const MPlexLV &psPar, MPlexQI &Chg, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &propFlags, const bool propToHit)
 
void kalmanPropagateAndUpdatePlane (const MPlexLS &psErr, const MPlexLV &psPar, MPlexQI &Chg, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &propFlags, const bool propToHit)
 
void kalmanUpdate (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
 
void kalmanUpdateEndcap (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
 
void kalmanUpdatePlane (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
 
template<class T , class U >
bool operator== (const CcAlloc< T > &a, const CcAlloc< U > &b)
 
bool passStripChargePCMfromTrack (int itrack, bool isBarrel, unsigned int pcm, unsigned int pcmMin, const MPlexLV &pPar, const MPlexHS &msErr)
 
void print (std::string_view label, const MeasurementState &s)
 
void print (const TrackState &s)
 
void print (std::string pfx, int itrack, const Track &trk, bool print_hits=false)
 
void print (std::string pfx, const TrackState &s)
 
void print (std::string pfx, int itrack, const Track &trk, const Event &ev)
 
void propagateHelixToPlaneMPlex (const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexHV &plPnt, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
 
void propagateHelixToRMPlex (const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
 
void propagateHelixToZMPlex (const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
 
void propagateLineToRMPlex (const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
 
void run_OneIteration (const TrackerInfo &trackerInfo, const IterationConfig &itconf, const EventOfHits &eoh, const std::vector< const std::vector< bool > *> &hit_masks, MkBuilder &builder, TrackVec &seeds, TrackVec &out_tracks, bool do_seed_clean, bool do_backward_fit, bool do_remove_duplicates)
 
std::vector< double > runBtpCe_MultiIter (Event &ev, const EventOfHits &eoh, MkBuilder &builder, int n)
 
double runBuildingTestPlexBestHit (Event &ev, const EventOfHits &eoh, MkBuilder &builder)
 
double runBuildingTestPlexCloneEngine (Event &ev, const EventOfHits &eoh, MkBuilder &builder)
 
void runBuildingTestPlexDumbCMSSW (Event &ev, const EventOfHits &eoh, MkBuilder &builder)
 
double runBuildingTestPlexStandard (Event &ev, const EventOfHits &eoh, MkBuilder &builder)
 
double runFittingTestPlex (Event &ev, std::vector< Track > &rectracks)
 
void sincos4 (const float x, float &sin, float &cos)
 
bool sortByEta (const Hit &hit1, const Hit &hit2)
 
bool sortByHitsChi2 (const std::pair< Track, TrackState > &cand1, const std::pair< Track, TrackState > &cand2)
 
bool sortByHitsChi2 (const Track &cand1, const Track &cand2)
 
bool sortByPhi (const Hit &hit1, const Hit &hit2)
 
bool sortByScoreCand (const Track &cand1, const Track &cand2)
 
bool sortByScoreStruct (const IdxChi2List &cand1, const IdxChi2List &cand2)
 
bool sortByScoreTrackCand (const TrackCand &cand1, const TrackCand &cand2)
 
bool sortByZ (const Hit &hit1, const Hit &hit2)
 
bool sortIDsByChi2 (const idchi2Pair &cand1, const idchi2Pair &cand2)
 
bool sortTracksByEta (const Track &track1, const Track &track2)
 
bool sortTracksByPhi (const Track &track1, const Track &track2)
 
template<typename T >
T sqr (T x)
 
float squashPhiGeneral (float phi)
 
template<typename Vector >
void squashPhiGeneral (Vector &v)
 
float squashPhiMinimal (float phi)
 
void squashPhiMPlex (MPlexLV &par, const int N_proc)
 
void squashPhiMPlexGeneral (MPlexLV &par, const int N_proc)
 
RVec state2mom (const miprops::State &s)
 
RVec state2pos (const miprops::State &s)
 
State state2state (const miprops::State &s)
 
RVec statep2mom (const miprops::StatePlex &s, int i)
 
RVec statep2pos (const miprops::StatePlex &s, int i)
 
PropState statep2propstate (const miprops::StatePlex &s, int i)
 
State statep2state (const miprops::StatePlex &s, int i)
 
void to_json (nlohmann::ordered_json &nlohmann_json_j, const mkfit::LayerControl &nlohmann_json_t)
 
void to_json (nlohmann::json &nlohmann_json_j, const mkfit::LayerControl &nlohmann_json_t)
 
void to_json (nlohmann::ordered_json &nlohmann_json_j, const mkfit::SteeringParams &nlohmann_json_t)
 
void to_json (nlohmann::json &nlohmann_json_j, const mkfit::SteeringParams &nlohmann_json_t)
 
void to_json (nlohmann::json &nlohmann_json_j, const mkfit::IterationLayerConfig &nlohmann_json_t)
 
void to_json (nlohmann::ordered_json &nlohmann_json_j, const mkfit::IterationLayerConfig &nlohmann_json_t)
 
void to_json (nlohmann::json &nlohmann_json_j, const mkfit::IterationParams &nlohmann_json_t)
 
void to_json (nlohmann::ordered_json &nlohmann_json_j, const mkfit::IterationParams &nlohmann_json_t)
 
void to_json (nlohmann::ordered_json &nlohmann_json_j, const mkfit::IterationConfig &nlohmann_json_t)
 
void to_json (nlohmann::json &nlohmann_json_j, const mkfit::IterationConfig &nlohmann_json_t)
 
void to_json (nlohmann::json &nlohmann_json_j, const mkfit::IterationsInfo &nlohmann_json_t)
 
void to_json (nlohmann::ordered_json &nlohmann_json_j, const mkfit::IterationsInfo &nlohmann_json_t)
 
RVec track2mom (const TrackBase &s)
 
RVec track2pos (const TrackBase &s)
 
State track2state (const TrackBase &s)
 

Variables

bool g_debug = true
 
ExecutionContext g_exe_ctx
 
constexpr Matriplex::idx_t HH = 3
 
constexpr Matriplex::idx_t LL = 6
 
static constexpr int MPlexHitIdxMax = 16
 
constexpr Matriplex::idx_t NN = 8
 

Typedef Documentation

◆ clean_duplicates_cf

using mkfit::clean_duplicates_cf = typedef void(TrackVec &, const IterationConfig &)

Definition at line 30 of file FunctionTypes.h.

◆ clean_duplicates_func

using mkfit::clean_duplicates_func = typedef std::function<clean_duplicates_cf>

Definition at line 31 of file FunctionTypes.h.

◆ clean_seeds_cf

using mkfit::clean_seeds_cf = typedef int(TrackVec &, const IterationConfig &, const BeamSpot &)

Definition at line 21 of file FunctionTypes.h.

◆ clean_seeds_func

using mkfit::clean_seeds_func = typedef std::function<clean_seeds_cf>

Definition at line 22 of file FunctionTypes.h.

◆ cleanOptsMap

typedef std::map<std::string, std::pair<cleanOpts, std::string> > mkfit::cleanOptsMap

Definition at line 25 of file ConfigStandalone.h.

◆ DeadVec

typedef std::vector<DeadRegion> mkfit::DeadVec

Definition at line 280 of file Hit.h.

◆ EventVec

typedef std::vector<Event> mkfit::EventVec

Definition at line 84 of file Event.h.

◆ filter_candidates_cf

using mkfit::filter_candidates_cf = typedef bool(const TrackCand &, const MkJob &)

Definition at line 27 of file FunctionTypes.h.

◆ filter_candidates_func

using mkfit::filter_candidates_func = typedef std::function<filter_candidates_cf>

Definition at line 28 of file FunctionTypes.h.

◆ FitValLayMap

typedef std::map<int, FitVal> mkfit::FitValLayMap

Definition at line 24 of file TTreeValidation.h.

◆ FltLayerPairVec

typedef std::vector<std::pair<int, float> > mkfit::FltLayerPairVec

Definition at line 121 of file TrackExtra.h.

◆ HitIdxVec

typedef std::vector<int> mkfit::HitIdxVec

Definition at line 18 of file Track.h.

◆ HitLayerMap

typedef std::map<int, std::vector<int> > mkfit::HitLayerMap

Definition at line 19 of file Track.h.

◆ HitVec

typedef std::vector< Hit > mkfit::HitVec

Definition at line 11 of file MkFitHitWrapper.h.

◆ HoTVec

typedef std::vector<HitOnTrack> mkfit::HoTVec

Definition at line 272 of file Hit.h.

◆ idchi2Pair

typedef std::pair<int, float> mkfit::idchi2Pair

Definition at line 232 of file TrackExtra.cc.

◆ idchi2PairVec

typedef std::vector<idchi2Pair> mkfit::idchi2PairVec

Definition at line 233 of file TrackExtra.cc.

◆ LayIdxIDVecMapMap

typedef std::map<int, std::map<int, std::vector<int> > > mkfit::LayIdxIDVecMapMap

Definition at line 37 of file TrackExtra.h.

◆ matchOptsMap

typedef std::map<std::string, std::pair<matchOpts, std::string> > mkfit::matchOptsMap

Definition at line 29 of file ConfigStandalone.h.

◆ MatriplexHitPacker

Definition at line 138 of file MatriplexPackers.h.

◆ MatriplexHoTPacker

Definition at line 141 of file MatriplexPackers.h.

◆ MatriplexTrackPacker

Definition at line 139 of file MatriplexPackers.h.

◆ MCHitInfoVec

typedef std::vector<MCHitInfo> mkfit::MCHitInfoVec

Definition at line 119 of file Hit.h.

◆ MPlex22

typedef Matriplex::Matriplex<float, 2, 2, NN> mkfit::MPlex22

Definition at line 60 of file Matrix.h.

◆ MPlex2H

typedef Matriplex::Matriplex<float, 2, HH, NN> mkfit::MPlex2H

Definition at line 69 of file Matrix.h.

◆ MPlex2S

typedef Matriplex::MatriplexSym<float, 2, NN> mkfit::MPlex2S

Definition at line 62 of file Matrix.h.

◆ MPlex2V

typedef Matriplex::Matriplex<float, 2, 1, NN> mkfit::MPlex2V

Definition at line 61 of file Matrix.h.

◆ MPlex55

typedef Matriplex::Matriplex<float, 5, 5, NN> mkfit::MPlex55

Definition at line 56 of file Matrix.h.

◆ MPlex56

typedef Matriplex::Matriplex<float, 5, 6, NN> mkfit::MPlex56

Definition at line 57 of file Matrix.h.

◆ MPlex65

typedef Matriplex::Matriplex<float, 6, 5, NN> mkfit::MPlex65

Definition at line 58 of file Matrix.h.

◆ MPlexH2

typedef Matriplex::Matriplex<float, HH, 2, NN> mkfit::MPlexH2

Definition at line 68 of file Matrix.h.

◆ MPlexHH

typedef Matriplex::Matriplex<float, HH, HH, NN> mkfit::MPlexHH

Definition at line 52 of file Matrix.h.

◆ MPlexHitIdx

using mkfit::MPlexHitIdx = typedef Matriplex::Matriplex<int, MPlexHitIdxMax, 1, NN>

Definition at line 13 of file MkFitter.h.

◆ MPlexHL

typedef Matriplex::Matriplex<float, HH, LL, NN> mkfit::MPlexHL

Definition at line 65 of file Matrix.h.

◆ MPlexHS

typedef Matriplex::MatriplexSym<float, HH, NN> mkfit::MPlexHS

Definition at line 54 of file Matrix.h.

◆ MPlexHV

typedef Matriplex::Matriplex<float, HH, 1, NN> mkfit::MPlexHV

Definition at line 53 of file Matrix.h.

◆ MPlexL2

typedef Matriplex::Matriplex<float, LL, 2, NN> mkfit::MPlexL2

Definition at line 67 of file Matrix.h.

◆ MPlexLH

typedef Matriplex::Matriplex<float, LL, HH, NN> mkfit::MPlexLH

Definition at line 64 of file Matrix.h.

◆ MPlexLL

typedef Matriplex::Matriplex<float, LL, LL, NN> mkfit::MPlexLL

Definition at line 48 of file Matrix.h.

◆ MPlexLS

typedef Matriplex::MatriplexSym<float, LL, NN> mkfit::MPlexLS

Definition at line 50 of file Matrix.h.

◆ MPlexLV

typedef Matriplex::Matriplex<float, LL, 1, NN> mkfit::MPlexLV

Definition at line 49 of file Matrix.h.

◆ MPlexQB

typedef Matriplex::Matriplex<bool, 1, 1, NN> mkfit::MPlexQB

Definition at line 77 of file Matrix.h.

◆ MPlexQF

typedef Matriplex::Matriplex<float, 1, 1, NN> mkfit::MPlexQF

Definition at line 71 of file Matrix.h.

◆ MPlexQH

typedef Matriplex::Matriplex<short, 1, 1, NN> mkfit::MPlexQH

Definition at line 74 of file Matrix.h.

◆ MPlexQHoT

using mkfit::MPlexQHoT = typedef Matriplex::Matriplex<HitOnTrack, 1, 1, NN>

Definition at line 14 of file MkFitter.h.

◆ MPlexQI

typedef Matriplex::Matriplex<int, 1, 1, NN> mkfit::MPlexQI

Definition at line 72 of file Matrix.h.

◆ MPlexQUH

typedef Matriplex::Matriplex<unsigned short, 1, 1, NN> mkfit::MPlexQUH

Definition at line 75 of file Matrix.h.

◆ MPlexQUI

typedef Matriplex::Matriplex<unsigned int, 1, 1, NN> mkfit::MPlexQUI

Definition at line 73 of file Matrix.h.

◆ PairIdx

typedef std::array<int, 2> mkfit::PairIdx

Definition at line 39 of file TrackExtra.h.

◆ PairIdxVec

typedef std::vector<PairIdx> mkfit::PairIdxVec

Definition at line 40 of file TrackExtra.h.

◆ partition_seeds_cf

using mkfit::partition_seeds_cf = typedef void(const TrackerInfo &, const TrackVec &, const EventOfHits &, IterationSeedPartition &)

Definition at line 24 of file FunctionTypes.h.

◆ partition_seeds_func

using mkfit::partition_seeds_func = typedef std::function<partition_seeds_cf>

Definition at line 25 of file FunctionTypes.h.

◆ RedTrackVec

typedef std::vector<ReducedTrack> mkfit::RedTrackVec

Definition at line 35 of file TrackExtra.h.

◆ seedOptsMap

typedef std::map<std::string, std::pair<seedOpts, std::string> > mkfit::seedOptsMap

Definition at line 21 of file ConfigStandalone.h.

◆ SimTkIDInfo

typedef std::pair<int, int> mkfit::SimTkIDInfo

Definition at line 17 of file Track.h.

◆ SMatrix22

typedef ROOT::Math::SMatrix<float, 2> mkfit::SMatrix22

Definition at line 16 of file MatrixSTypes.h.

◆ SMatrix26

typedef ROOT::Math::SMatrix<float, 2, 6> mkfit::SMatrix26

Definition at line 23 of file MatrixSTypes.h.

◆ SMatrix33

typedef ROOT::Math::SMatrix<float, 3> mkfit::SMatrix33

Definition at line 12 of file MatrixSTypes.h.

◆ SMatrix36

typedef ROOT::Math::SMatrix<float, 3, 6> mkfit::SMatrix36

Definition at line 20 of file MatrixSTypes.h.

◆ SMatrix62

typedef ROOT::Math::SMatrix<float, 6, 2> mkfit::SMatrix62

Definition at line 24 of file MatrixSTypes.h.

◆ SMatrix63

typedef ROOT::Math::SMatrix<float, 6, 3> mkfit::SMatrix63

Definition at line 21 of file MatrixSTypes.h.

◆ SMatrix66

typedef ROOT::Math::SMatrix<float, 6> mkfit::SMatrix66

Definition at line 9 of file MatrixSTypes.h.

◆ SMatrixSym22

typedef ROOT::Math::SMatrix<float, 2, 2, ROOT::Math::MatRepSym<float, 2> > mkfit::SMatrixSym22

Definition at line 17 of file MatrixSTypes.h.

◆ SMatrixSym33

typedef ROOT::Math::SMatrix<float, 3, 3, ROOT::Math::MatRepSym<float, 3> > mkfit::SMatrixSym33

Definition at line 13 of file MatrixSTypes.h.

◆ SMatrixSym66

typedef ROOT::Math::SMatrix<float, 6, 6, ROOT::Math::MatRepSym<float, 6> > mkfit::SMatrixSym66

Definition at line 8 of file MatrixSTypes.h.

◆ SVector2

typedef ROOT::Math::SVector<float, 2> mkfit::SVector2

Definition at line 18 of file MatrixSTypes.h.

◆ SVector3

typedef ROOT::Math::SVector<float, 3> mkfit::SVector3

Definition at line 14 of file MatrixSTypes.h.

◆ SVector6

typedef ROOT::Math::SVector<float, 6> mkfit::SVector6

Definition at line 10 of file MatrixSTypes.h.

◆ TkIDtoFitValLayMapMap

typedef std::unordered_map<int, FitValLayMap> mkfit::TkIDtoFitValLayMapMap

Definition at line 25 of file TTreeValidation.h.

◆ TkIDToTkIDMap

typedef std::unordered_map<int, int> mkfit::TkIDToTkIDMap

Definition at line 124 of file TrackExtra.h.

◆ TkIDToTkIDVecMap

typedef std::unordered_map<int, std::vector<int> > mkfit::TkIDToTkIDVecMap

Definition at line 125 of file TrackExtra.h.

◆ TkIDToTSLayerPairVecMap

typedef std::unordered_map<int, TSLayerPairVec> mkfit::TkIDToTSLayerPairVecMap

Definition at line 127 of file TrackExtra.h.

◆ TkIDToTSMap

typedef std::unordered_map<int, TrackState> mkfit::TkIDToTSMap

Definition at line 126 of file TrackExtra.h.

◆ TkIDToTSVecVec

typedef std::vector<TSVec> mkfit::TkIDToTSVecVec

Definition at line 119 of file TrackExtra.h.

◆ track_score_cf

using mkfit::track_score_cf = typedef float(const int nfoundhits, const int ntailholes, const int noverlaphits, const int nmisshits, const float chi2, const float pt, const bool inFindCandidates)

Definition at line 39 of file FunctionTypes.h.

◆ track_score_func

using mkfit::track_score_func = typedef std::function<track_score_cf>

Definition at line 40 of file FunctionTypes.h.

◆ TrackExtraVec

typedef std::vector< TrackExtra > mkfit::TrackExtraVec

Definition at line 13 of file MkStandaloneSeqs.h.

◆ TrackVec

typedef std::vector< Track > mkfit::TrackVec

Definition at line 8 of file MkFitOutputWrapper.h.

◆ TrackVecVec

typedef std::vector<TrackVec> mkfit::TrackVecVec

Definition at line 583 of file Track.h.

◆ TripletIdx

typedef std::array<int, 3> mkfit::TripletIdx

Definition at line 41 of file TrackExtra.h.

◆ TripletIdxVec

typedef std::vector<TripletIdx> mkfit::TripletIdxVec

Definition at line 42 of file TrackExtra.h.

◆ TrkIDLaySetMap

typedef std::map<int, std::unordered_set<int> > mkfit::TrkIDLaySetMap

Definition at line 38 of file TrackExtra.h.

◆ TSLayerPairVec

typedef std::vector<std::pair<int, TrackState> > mkfit::TSLayerPairVec

Definition at line 120 of file TrackExtra.h.

◆ TSVec

typedef std::vector<TrackState> mkfit::TSVec

Definition at line 118 of file TrackExtra.h.

Enumeration Type Documentation

◆ cleanOpts

Enumerator
noCleaning 
cleanSeedsN2 
cleanSeedsPure 
cleanSeedsBadLabel 

Definition at line 24 of file ConfigStandalone.h.

◆ KalmanFilterOperation

Enumerator
KFO_Calculate_Chi2 
KFO_Update_Params 
KFO_Local_Cov 

Definition at line 11 of file KalmanUtilsMPlex.h.

◆ matchOpts

Enumerator
trkParamBased 
hitBased 
labelBased 

Definition at line 28 of file ConfigStandalone.h.

◆ PropagationFlagsEnum

Enumerator
PF_none 
PF_use_param_b_field 
PF_apply_material 
PF_copy_input_state_on_fail 

Definition at line 8 of file PropagationConfig.h.

◆ seedOpts

Enumerator
simSeeds 
cmsswSeeds 
findSeeds 

Definition at line 20 of file ConfigStandalone.h.

◆ TkLayout

enum mkfit::TkLayout
strong
Enumerator
phase0 
phase1 
phase2 

Definition at line 8 of file LayerNumberConverter.h.

◆ WithinSensitiveRegion_e

Enumerator
WSR_Undef 
WSR_Inside 
WSR_Edge 
WSR_Outside 
WSR_Failed 

Definition at line 17 of file TrackerInfo.h.

Function Documentation

◆ applyMaterialEffects()

void mkfit::applyMaterialEffects ( const MPlexQF hitsRl,
const MPlexQF hitsXi,
const MPlexQF propSign,
const MPlexHV plNrm,
MPlexLS outErr,
MPlexLV outPar,
const int  N_proc 
)

Definition at line 1247 of file PropagationMPlex.cc.

References funct::abs(), HLT_2024v14_cff::beta, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), funct::cos(), plot_hgcal_utils::dEdx, MillePedeFileConverter_cfg::e, f, CustomPhysics_cfi::gamma, Exhume::I, dqm-mbProfile::log, SiStripPI::max, hlt_dqm_clientPB-live_cfg::me, dqmiodumpmetadata::n, NN, AlCaHLTBitMon_ParallelJobs::p, SiStripOfflineCRack_cfg::p2, DiDispStaMuonMonitor_cfi::pt, funct::sin(), mathSSE::sqrt(), theta(), mkfit::Config::usePtMultScat, and cms::cuda::wmax.

Referenced by propagateHelixToPlaneMPlex(), propagateHelixToRMPlex(), and propagateHelixToZMPlex().

1253  {
1254 #pragma omp simd
1255  for (int n = 0; n < NN; ++n) {
1256  if (n >= N_proc)
1257  continue;
1258  float radL = hitsRl.constAt(n, 0, 0);
1259  if (radL < 1e-13f)
1260  continue; //ugly, please fixme
1261  const float theta = outPar.constAt(n, 5, 0);
1262  // const float pt = 1.f / outPar.constAt(n, 3, 0); //fixme, make sure it is positive?
1263  const float ipt = outPar.constAt(n, 3, 0);
1264  const float pt = 1.f / ipt; //fixme, make sure it is positive?
1265  const float ipt2 = ipt * ipt;
1266  const float p = pt / std::sin(theta);
1267  const float pz = p * std::cos(theta);
1268  const float p2 = p * p;
1269  constexpr float mpi = 0.140; // m=140 MeV, pion
1270  constexpr float mpi2 = mpi * mpi; // m=140 MeV, pion
1271  const float beta2 = p2 / (p2 + mpi2);
1272  const float beta = std::sqrt(beta2);
1273  //radiation lenght, corrected for the crossing angle (cos alpha from dot product of radius vector and momentum)
1274  const float invCos =
1275  p / std::abs(pt * std::cos(outPar.constAt(n, 4, 0)) * plNrm.constAt(n, 0, 0) +
1276  pt * std::sin(outPar.constAt(n, 4, 0)) * plNrm.constAt(n, 1, 0) + pz * plNrm.constAt(n, 2, 0));
1277  radL = radL * invCos; //fixme works only for barrel geom
1278  // multiple scattering
1279  //vary independently phi and theta by the rms of the planar multiple scattering angle
1280  // XXX-KMD radL < 0, see your fixme above! Repeating bailout
1281  if (radL < 1e-13f)
1282  continue;
1283  // const float thetaMSC = 0.0136f*std::sqrt(radL)*(1.f+0.038f*std::log(radL))/(beta*p);// eq 32.15
1284  // const float thetaMSC2 = thetaMSC*thetaMSC;
1285  const float thetaMSC = 0.0136f * (1.f + 0.038f * std::log(radL)) / (beta * p); // eq 32.15
1286  const float thetaMSC2 = thetaMSC * thetaMSC * radL;
1288  outErr.At(n, 3, 3) += thetaMSC2 * pz * pz * ipt2 * ipt2;
1289  outErr.At(n, 3, 5) -= thetaMSC2 * pz * ipt2;
1290  outErr.At(n, 4, 4) += thetaMSC2 * p2 * ipt2;
1291  outErr.At(n, 5, 5) += thetaMSC2;
1292  } else {
1293  outErr.At(n, 4, 4) += thetaMSC2;
1294  outErr.At(n, 5, 5) += thetaMSC2;
1295  }
1296  //std::cout << "beta=" << beta << " p=" << p << std::endl;
1297  //std::cout << "multiple scattering thetaMSC=" << thetaMSC << " thetaMSC2=" << thetaMSC2 << " radL=" << radL << std::endl;
1298  // energy loss
1299  // XXX-KMD beta2 = 1 => 1 / sqrt(0)
1300  // const float gamma = 1.f/std::sqrt(1.f - std::min(beta2, 0.999999f));
1301  // const float gamma2 = gamma*gamma;
1302  const float gamma2 = (p2 + mpi2) / mpi2;
1303  const float gamma = std::sqrt(gamma2); //1.f/std::sqrt(1.f - std::min(beta2, 0.999999f));
1304  constexpr float me = 0.0005; // m=0.5 MeV, electron
1305  const float wmax = 2.f * me * beta2 * gamma2 / (1.f + 2.f * gamma * me / mpi + me * me / (mpi * mpi));
1306  constexpr float I = 16.0e-9 * 10.75;
1307  const float deltahalf = std::log(28.816e-9f * std::sqrt(2.33f * 0.498f) / I) + std::log(beta * gamma) - 0.5f;
1308  const float dEdx =
1309  beta < 1.f
1310  ? (2.f * (hitsXi.constAt(n, 0, 0) * invCos *
1311  (0.5f * std::log(2.f * me * beta2 * gamma2 * wmax / (I * I)) - beta2 - deltahalf) / beta2))
1312  : 0.f; //protect against infs and nans
1313  // dEdx = dEdx*2.;//xi in cmssw is defined with an extra factor 0.5 with respect to formula 27.1 in pdg
1314  //std::cout << "dEdx=" << dEdx << " delta=" << deltahalf << " wmax=" << wmax << " Xi=" << hitsXi.constAt(n,0,0) << std::endl;
1315  const float dP = propSign.constAt(n, 0, 0) * dEdx / beta;
1316  outPar.At(n, 3, 0) = p / (std::max(p + dP, 0.001f) * pt); //stay above 1MeV
1317  //assume 100% uncertainty
1318  outErr.At(n, 3, 3) += dP * dP / (p2 * pt * pt);
1319  }
1320  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
constexpr bool usePtMultScat
Definition: Config.h:52
T sqrt(T t)
Definition: SSEVec.h:23
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::complex< double > I
Definition: I.h:8
double f[11][100]
Geom::Theta< T > theta() const
__host__ __device__ V V wmax

◆ calculateCharge() [1/2]

int mkfit::calculateCharge ( const Hit hit0,
const Hit hit1,
const Hit hit2 
)
inline

Definition at line 21 of file Track.h.

References mkfit::Hit::x(), and mkfit::Hit::y().

21  {
22  return ((hit2.y() - hit0.y()) * (hit2.x() - hit1.x()) > (hit2.y() - hit1.y()) * (hit2.x() - hit0.x()) ? 1 : -1);
23  }

◆ calculateCharge() [2/2]

int mkfit::calculateCharge ( const float  hit0_x,
const float  hit0_y,
const float  hit1_x,
const float  hit1_y,
const float  hit2_x,
const float  hit2_y 
)
inline

Definition at line 25 of file Track.h.

30  {
31  return ((hit2_y - hit0_y) * (hit2_x - hit1_x) > (hit2_y - hit1_y) * (hit2_x - hit0_x) ? 1 : -1);
32  }

◆ cdist()

float mkfit::cdist ( float  a)
inline

Definition at line 32 of file Config.h.

References a, mkfit::Const::PI, and mkfit::Const::TwoPI.

Referenced by mkfit::Event::clean_cms_seedtracks(), mkfit::StdSeq::clean_cms_seedtracks_iter(), mkfit::MkFinder::selectHitIndices(), and mkfit::MkFinder::selectHitIndicesV2().

32 { return a > Const::PI ? Const::TwoPI - a : a; }
constexpr float TwoPI
Definition: Config.h:8
constexpr float PI
Definition: Config.h:7
double a
Definition: hdecay.h:121

◆ CFMap()

void mkfit::CFMap ( const MPlexHH A,
const MPlexHV B,
MPlexHV C 
)
inline

Definition at line 89 of file ConformalUtilsMPlex.cc.

References A, a, ASSUME_ALIGNED, B, b, correctionTermsCaloMet_cff::C, DummyCfis::c, N, and NN.

Referenced by conformalFitMPlex().

89  {
90  using idx_t = Matriplex::idx_t;
91 
92  // C = A * B, C is 3x1, A is 3x3 , B is 3x1
93 
94  typedef float T;
95  typedef float Tv;
96  const idx_t N = NN;
97 
98  const T* a = A.fArray;
99  ASSUME_ALIGNED(a, 64);
100  const Tv* b = B.fArray;
101  ASSUME_ALIGNED(b, 64);
102  Tv* c = C.fArray;
103  ASSUME_ALIGNED(c, 64);
104 
105 #include "RecoTracker/MkFitCore/standalone/CFMatrix33Vector3.ah"
106  }
Definition: APVGainStruct.h:7
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
#define N
Definition: blowfish.cc:9
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
Definition: APVGainStruct.h:7
long double T
#define ASSUME_ALIGNED(a, b)

◆ computeHelixChi2()

template<typename Vector , typename Matrix >
float mkfit::computeHelixChi2 ( const Vector simV,
const Vector recoV,
const Matrix &  recoM,
const bool  diagOnly = false 
)

Definition at line 638 of file Track.h.

References diagonalOnly(), and squashPhiGeneral().

Referenced by mkfit::TTreeValidation::fillEfficiencyTree(), mkfit::TTreeValidation::fillFakeRateTree(), mkfit::TrackExtra::setCMSSWTrackIDInfoByHits(), and mkfit::TrackExtra::setCMSSWTrackIDInfoByTrkParams().

638  {
639  Vector diffV = recoV - simV;
640  if (diffV.kSize > 2)
641  squashPhiGeneral(diffV);
642 
643  Matrix recoM_tmp = recoM;
644  if (diagOnly)
645  diagonalOnly(recoM_tmp);
646  int invFail(0);
647  const Matrix recoMI = recoM_tmp.InverseFast(invFail);
648 
649  return ROOT::Math::Dot(diffV * recoMI, diffV) / (diffV.kSize - 1);
650  }
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
void squashPhiGeneral(Vector &v)
Definition: Track.h:631
portabletest::Matrix Matrix

◆ conformalFitMPlex()

void mkfit::conformalFitMPlex ( bool  fitting,
MPlexQI  seedID,
MPlexLS outErr,
MPlexLV outPar,
const MPlexHV msPar0,
const MPlexHV msPar1,
const MPlexHV msPar2 
)

Definition at line 111 of file ConformalUtilsMPlex.cc.

References A, a, funct::abs(), b, mkfit::Config::Bfield, correctionTermsCaloMet_cff::C, CFMap(), dcall, debug, dprint, dprintf, f, g_debug, getPhi(), getRad2(), getTheta(), hipo(), mps_fire::i, Matriplex::invertCramer(), dqmiolumiharvest::j, dqmdumpme::k, N, dqmiodumpmetadata::n, NN, mkfit::TrackState::parameters, mkfit::Config::phierr012, mkfit::Config::phierr049, mkfit::Const::PI3Over4, mkfit::Const::PIOver4, print(), pv::pT, mkfit::Config::ptinverr012, mkfit::Config::ptinverr049, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, diffTwoXMLs::r2, mkfit::Const::sol, mkfit::Config::thetaerr012, mkfit::Config::thetaerr049, findQualityFiles::v, mkfit::Config::varR, mkfit::Config::varXY, mkfit::Config::varZ, and x.

117  {
118  bool debug(false);
119 
120  using idx_t = Matriplex::idx_t;
121  const idx_t N = NN;
122 
123  // Store positions in mplex vectors... could consider storing in a 3x3 matrix, too
124  MPlexHV x, y, z, r2;
125 #pragma omp simd
126  for (int n = 0; n < N; ++n) {
127  x.At(n, 0, 0) = msPar0.constAt(n, 0, 0);
128  x.At(n, 1, 0) = msPar1.constAt(n, 0, 0);
129  x.At(n, 2, 0) = msPar2.constAt(n, 0, 0);
130 
131  y.At(n, 0, 0) = msPar0.constAt(n, 1, 0);
132  y.At(n, 1, 0) = msPar1.constAt(n, 1, 0);
133  y.At(n, 2, 0) = msPar2.constAt(n, 1, 0);
134 
135  z.At(n, 0, 0) = msPar0.constAt(n, 2, 0);
136  z.At(n, 1, 0) = msPar1.constAt(n, 2, 0);
137  z.At(n, 2, 0) = msPar2.constAt(n, 2, 0);
138 
139  for (int i = 0; i < 3; ++i) {
140  r2.At(n, i, 0) = getRad2(x.constAt(n, i, 0), y.constAt(n, i, 0));
141  }
142  }
143 
144  // Start setting the output parameters
145 #pragma omp simd
146  for (int n = 0; n < N; ++n) {
147  outPar.At(n, 0, 0) = x.constAt(n, 0, 0);
148  outPar.At(n, 1, 0) = y.constAt(n, 0, 0);
149  outPar.At(n, 2, 0) = z.constAt(n, 0, 0);
150  }
151 
152  // Use r-phi smearing to set initial error estimation for positions
153  // trackStates already initialized to identity for seeding ... don't store off-diag 0's, zero's for fitting set outside CF
154 #pragma omp simd
155  for (int n = 0; n < N; ++n) {
156  const float varPhi = Config::varXY / r2.constAt(n, 0, 0);
157  const float invvarR2 = Config::varR / r2.constAt(n, 0, 0);
158 
159  outErr.At(n, 0, 0) =
160  x.constAt(n, 0, 0) * x.constAt(n, 0, 0) * invvarR2 + y.constAt(n, 0, 0) * y.constAt(n, 0, 0) * varPhi;
161  outErr.At(n, 0, 1) = x.constAt(n, 0, 0) * y.constAt(n, 0, 0) * (invvarR2 - varPhi);
162 
163  outErr.At(n, 1, 0) = outErr.constAt(n, 0, 1);
164  outErr.At(n, 1, 1) =
165  y.constAt(n, 0, 0) * y.constAt(n, 0, 0) * invvarR2 + x.constAt(n, 0, 0) * x.constAt(n, 0, 0) * varPhi;
166 
167  outErr.At(n, 2, 2) = Config::varZ;
168  }
169 
170  MPlexQF initPhi;
171  MPlexQI xtou; // bool to determine "split space", i.e. map x to u or v
172 #pragma omp simd
173  for (int n = 0; n < N; ++n) {
174  initPhi.At(n, 0, 0) = std::abs(getPhi(x.constAt(n, 0, 0), y.constAt(n, 0, 0)));
175  xtou.At(n, 0, 0) =
176  ((initPhi.constAt(n, 0, 0) < Const::PIOver4 || initPhi.constAt(n, 0, 0) > Const::PI3Over4) ? 1 : 0);
177  }
178 
179  MPlexHV u, v;
180 #pragma omp simd
181  for (int n = 0; n < N; ++n) {
182  if (xtou.At(n, 0, 0)) // x mapped to u
183  {
184  for (int i = 0; i < 3; ++i) {
185  u.At(n, i, 0) = x.constAt(n, i, 0) / r2.constAt(n, i, 0);
186  v.At(n, i, 0) = y.constAt(n, i, 0) / r2.constAt(n, i, 0);
187  }
188  } else // x mapped to v
189  {
190  for (int i = 0; i < 3; ++i) {
191  u.At(n, i, 0) = y.constAt(n, i, 0) / r2.constAt(n, i, 0);
192  v.At(n, i, 0) = x.constAt(n, i, 0) / r2.constAt(n, i, 0);
193  }
194  }
195  }
196 
197  MPlexHH A;
198  //#pragma omp simd // triggers an internal compiler error with icc 18.0.2!
199  for (int n = 0; n < N; ++n) {
200  for (int i = 0; i < 3; ++i) {
201  A.At(n, i, 0) = 1.0f;
202  A.At(n, i, 1) = -u.constAt(n, i, 0);
203  A.At(n, i, 2) = -u.constAt(n, i, 0) * u.constAt(n, i, 0);
204  }
205  }
207  MPlexHV C;
208  CFMap(A, v, C);
209 
210  MPlexQF a, b;
211 #pragma omp simd
212  for (int n = 0; n < N; ++n) {
213  b.At(n, 0, 0) = 1.0f / (2.0f * C.constAt(n, 0, 0));
214  a.At(n, 0, 0) = b.constAt(n, 0, 0) * C.constAt(n, 1, 0);
215  }
216 
217  // constant used throughtout
218  const float k = (Const::sol * Config::Bfield) / 100.0f;
219 
220  MPlexQF vrx, vry, pT, px, py, pz;
221 #pragma omp simd
222  for (int n = 0; n < N; ++n) {
223  vrx.At(n, 0, 0) =
224  (xtou.constAt(n, 0, 0) ? x.constAt(n, 0, 0) - a.constAt(n, 0, 0) : x.constAt(n, 0, 0) - b.constAt(n, 0, 0));
225  vry.At(n, 0, 0) =
226  (xtou.constAt(n, 0, 0) ? y.constAt(n, 0, 0) - b.constAt(n, 0, 0) : y.constAt(n, 0, 0) - a.constAt(n, 0, 0));
227  pT.At(n, 0, 0) = k * hipo(vrx.constAt(n, 0, 0), vry.constAt(n, 0, 0));
228  px.At(n, 0, 0) = std::copysign(k * vry.constAt(n, 0, 0), x.constAt(n, 2, 0) - x.constAt(n, 0, 0));
229  py.At(n, 0, 0) = std::copysign(k * vrx.constAt(n, 0, 0), y.constAt(n, 2, 0) - y.constAt(n, 0, 0));
230  pz.At(n, 0, 0) = (pT.constAt(n, 0, 0) * (z.constAt(n, 2, 0) - z.constAt(n, 0, 0))) /
231  hipo((x.constAt(n, 2, 0) - x.constAt(n, 0, 0)), (y.constAt(n, 2, 0) - y.constAt(n, 0, 0)));
232  }
233 
234 #pragma omp simd
235  for (int n = 0; n < N; ++n) {
236  outPar.At(n, 3, 0) = 1.0f / pT.constAt(n, 0, 0);
237  outPar.At(n, 4, 0) = getPhi(px.constAt(n, 0, 0), py.constAt(n, 0, 0));
238  outPar.At(n, 5, 0) = getTheta(pT.constAt(n, 0, 0), pz.constAt(n, 0, 0));
239 #ifdef INWARDFIT // arctan is odd, so pz -> -pz means theta -> -theta
240  if (fitting)
241  outPar.At(n, 5, 0) *= -1.0f;
242 #endif
243  }
244 
245 #pragma omp simd
246  for (int n = 0; n < N; ++n) {
247  outErr.At(n, 3, 3) =
249  outErr.At(n, 4, 4) = (fitting ? Config::phierr049 * Config::phierr049 : Config::phierr012 * Config::phierr012);
250  outErr.At(n, 5, 5) =
252  }
253 
254  if (debug && g_debug) {
255  for (int n = 0; n < N; ++n) {
256  dprintf("afterCF seedID: %1u \n", seedID.constAt(n, 0, 0));
257  // do a dumb copy out
258  TrackState updatedState;
259  for (int i = 0; i < 6; i++) {
260  updatedState.parameters[i] = outPar.constAt(n, i, 0);
261  for (int j = 0; j < 6; j++) {
262  updatedState.errors[i][j] = outErr.constAt(n, i, j);
263  }
264  }
265 
266  dcall(print("CCS", updatedState));
267  updatedState.convertFromCCSToCartesian();
268  dcall(print("Pol", updatedState));
269  dprint("--------------------------------");
270  }
271  }
272  }
Matriplex::Matriplex< float, HH, HH, NN > MPlexHH
Definition: Matrix.h:52
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
Definition: Matrix.h:53
float getTheta(float r, float z)
Definition: Hit.h:36
constexpr float phierr012
float float float z
constexpr float thetaerr049
#define dcall(x)
Definition: Debug.h:97
bool g_debug
Definition: Debug.cc:2
constexpr float varZ
constexpr float varR
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
constexpr float Bfield
Definition: Config.h:55
float getRad2(float x, float y)
Definition: Hit.h:30
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
constexpr float ptinverr049
double f[11][100]
Matriplex::Matriplex< int, 1, 1, NN > MPlexQI
Definition: Matrix.h:72
constexpr float thetaerr012
#define debug
Definition: HDRShower.cc:19
constexpr float sol
Definition: Config.h:13
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
#define N
Definition: blowfish.cc:9
void invertCramer(MPlex< T, D, D, N > &A, double *determ=nullptr)
Definition: Matriplex.h:730
float hipo(float x, float y)
Definition: Matrix.h:9
double b
Definition: hdecay.h:120
float getPhi(float x, float y)
Definition: Hit.h:34
#define dprint(x)
Definition: Debug.h:95
constexpr float varXY
double a
Definition: hdecay.h:121
constexpr float phierr049
void CFMap(const MPlexHH &A, const MPlexHV &B, MPlexHV &C)
float x
Definition: APVGainStruct.h:7
constexpr float PI3Over4
Definition: Config.h:11
constexpr float ptinverr012
#define dprintf(...)
Definition: Debug.h:98
constexpr float PIOver4
Definition: Config.h:10

◆ convertHits()

template<typename Traits , typename HitCollection >
edm::ProductID mkfit::convertHits ( const Traits &  traits,
const HitCollection hits,
mkfit::HitVec mkFitHits,
std::vector< TrackingRecHit const *> &  clusterIndexToHit,
std::vector< float > &  clusterChargeVec,
const TrackerTopology ttopo,
const TransientTrackingRecHitBuilder ttrhBuilder,
const MkFitGeometry mkFitGeom 
)

Definition at line 25 of file convertHits.h.

References ALCARECOTkAlJpsiMuMu_cff::charge, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), submitPVResolutionJobs::err, Exception, f, hfClusterShapes_cfi::hits, edm::ProductID::id(), TrackerTopology::isStereo(), TrackerTopology::layer(), LogTrace, MkFitGeometry::mkFitLayerNumber(), DetId::rawId(), DetId::subdetId(), MkFitGeometry::uniqueIdInLayer(), and UNLIKELY.

Referenced by MkFitSiPixelHitConverter::produce(), MkFitPhase2HitConverter::produce(), and MkFitSiStripHitConverter::produce().

32  {
33  if (hits.empty())
34  return edm::ProductID{};
35 
36  edm::ProductID clusterID;
37  {
38  const auto& lastClusterRef = hits.data().back().firstClusterRef();
39  clusterID = lastClusterRef.id();
40  if (lastClusterRef.index() >= mkFitHits.size()) {
41  auto const size = lastClusterRef.index();
42  mkFitHits.resize(size);
43  clusterIndexToHit.resize(size, nullptr);
44  if constexpr (Traits::applyCCC()) {
45  clusterChargeVec.resize(size, -1.f);
46  }
47  }
48  }
49 
50  for (const auto& detset : hits) {
51  const DetId detid = detset.detId();
52  const auto ilay = mkFitGeom.mkFitLayerNumber(detid);
53 
54  for (const auto& hit : detset) {
55  const auto charge = traits.clusterCharge(hit, detid);
56  if (!traits.passCCC(charge))
57  continue;
58 
59  const auto& gpos = hit.globalPosition();
60  SVector3 pos(gpos.x(), gpos.y(), gpos.z());
61  const auto& gerr = hit.globalPositionError();
63  err.At(0, 0) = gerr.cxx();
64  err.At(1, 1) = gerr.cyy();
65  err.At(2, 2) = gerr.czz();
66  err.At(0, 1) = gerr.cyx();
67  err.At(0, 2) = gerr.czx();
68  err.At(1, 2) = gerr.czy();
69 
70  auto clusterRef = hit.firstClusterRef();
71  if UNLIKELY (clusterRef.id() != clusterID) {
72  throw cms::Exception("LogicError")
73  << "Input hit collection has Refs to many cluster collections. Last hit had Ref to product " << clusterID
74  << ", but encountered Ref to product " << clusterRef.id() << " on detid " << detid.rawId();
75  }
76  const auto clusterIndex = clusterRef.index();
77  LogTrace("MkFitHitConverter") << "Adding hit detid " << detid.rawId() << " subdet " << detid.subdetId()
78  << " layer " << ttopo.layer(detid) << " isStereo " << ttopo.isStereo(detid)
79  << " zplus "
80  << " index " << clusterIndex << " ilay " << ilay;
81 
82  if UNLIKELY (clusterIndex >= mkFitHits.size()) {
83  mkFitHits.resize(clusterIndex + 1);
84  clusterIndexToHit.resize(clusterIndex + 1, nullptr);
85  if constexpr (Traits::applyCCC()) {
86  clusterChargeVec.resize(clusterIndex + 1, -1.f);
87  }
88  }
89  mkFitHits[clusterIndex] = mkfit::Hit(pos, err);
90  clusterIndexToHit[clusterIndex] = &hit;
91  if constexpr (Traits::applyCCC()) {
92  clusterChargeVec[clusterIndex] = charge;
93  }
94 
95  const auto uniqueIdInLayer = mkFitGeom.uniqueIdInLayer(ilay, detid.rawId());
96  traits.setDetails(mkFitHits[clusterIndex], *(hit.cluster()), uniqueIdInLayer, charge);
97  }
98  }
99  return clusterID;
100  }
size
Write out results.
unsigned int uniqueIdInLayer(int layer, unsigned int detId) const
Definition: MkFitGeometry.h:38
bool isStereo(const DetId &id) const
unsigned int layer(const DetId &id) const
#define LogTrace(id)
double f[11][100]
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
SeedingHitSet::ConstRecHitPointer Hit
ProductIndex id() const
Definition: ProductID.h:35
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
int mkFitLayerNumber(DetId detId) const
#define UNLIKELY(x)
Definition: Likely.h:21
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
ROOT::Math::SMatrix< float, 3, 3, ROOT::Math::MatRepSym< float, 3 > > SMatrixSym33
Definition: MatrixSTypes.h:13

◆ cube()

template<typename T >
T mkfit::cube ( T  x)
inline

Definition at line 18 of file Hit.h.

References x.

Referenced by getInvRadErr2().

18  {
19  return x * x * x;
20  }
float x

◆ diagonalOnly()

template<typename Matrix >
void mkfit::diagonalOnly ( Matrix &  m)
inline

Definition at line 27 of file MatrixSTypes.h.

References DummyCfis::c, and visualization-live-secondInstance_cfg::m.

Referenced by computeHelixChi2().

27  {
28  for (int r = 0; r < m.kRows; r++) {
29  for (int c = 0; c < m.kCols; c++) {
30  if (r != c)
31  m[r][c] = 0.f;
32  }
33  }
34  }

◆ dtime()

double mkfit::dtime ( )
inline

◆ dumpMatrix()

template<typename Matrix >
void mkfit::dumpMatrix ( Matrix  m)

Definition at line 37 of file MatrixSTypes.h.

References DummyCfis::c, gather_cfg::cout, and visualization-live-secondInstance_cfg::m.

Referenced by print().

37  {
38  for (int r = 0; r < m.kRows; ++r) {
39  for (int c = 0; c < m.kCols; ++c) {
40  std::cout << std::setw(12) << m.At(r, c) << " ";
41  }
42  std::cout << std::endl;
43  }
44  }

◆ evsi2ssinfo()

SimSeedInfo mkfit::evsi2ssinfo ( const Event ev,
int  seed_idx 
)

Definition at line 29 of file RntConversions.h.

References makeMEIFBenchmarkPlots::ev, SimSeedInfo::has_sim, mkfit::Event::SimLabelFromHits::is_set(), mkfit::Event::SimLabelFromHits::label, SimSeedInfo::n_hits, mkfit::Event::SimLabelFromHits::n_hits, SimSeedInfo::n_match, mkfit::Event::SimLabelFromHits::n_match, SimSeedInfo::s_seed, SimSeedInfo::s_sim, fileCollector::seed, SimSeedInfo::seed_idx, SimSeedInfo::seed_lbl, SimSeedInfo::sim_lbl, and track2state().

29  {
30  SimSeedInfo ssi;
31  Event::SimLabelFromHits slfh = ev->simLabelForCurrentSeed(seed_idx);
32  if (slfh.is_set()) {
33  ssi.s_sim = track2state(ev->simTracks_[slfh.label]);
34  ssi.sim_lbl = slfh.label;
35  ssi.n_hits = slfh.n_hits;
36  ssi.n_match = slfh.n_match;
37  ssi.has_sim = true;
38  }
39  auto seed = ev->currentSeed(seed_idx);
40  ssi.s_seed = track2state(seed);
41  ssi.seed_lbl = seed.label();
42  ssi.seed_idx = seed_idx;
43  return ssi;
44  }
int seed_lbl
Definition: RntStructs.h:50
bool has_sim
Definition: RntStructs.h:52
State track2state(const TrackBase &s)
State s_sim
Definition: RntStructs.h:48
int seed_idx
Definition: RntStructs.h:50
State s_seed
Definition: RntStructs.h:49

◆ execTrackerInfoCreatorPlugin()

void mkfit::execTrackerInfoCreatorPlugin ( const std::string &  base,
TrackerInfo ti,
IterationsInfo ii,
bool  verbose 
)

Definition at line 92 of file ConfigStandalone.cc.

References edmMakeDummyCfis::base, beamvalidation::exit(), custom_jme_cff::foo, h, cuy::ii, castor_dqm_sourceclient_file_cfg::path, mkfit::TrackerInfo::read_bin_file(), edm_modernize_messagelogger::stat, submitPVResolutionJobs::stderr, AlCaHLTBitMon_QueryRunRegistry::string, and verbose.

Referenced by initGeom().

92  {
93  const std::string soname = base + ".so";
94  const std::string binname = base + ".bin";
95  struct stat st;
96 
97  int si = 0;
98  while (search_path[si]) {
100  const char *envpath = std::getenv("MKFIT_BASE");
101  if (envpath != nullptr) {
102  path += envpath;
103  path += "/";
104  }
105  path += search_path[si];
106  std::string sopath = path + soname;
107  if (stat(sopath.c_str(), &st) == 0) {
108  printf("execTrackerInfoCreatorPlugin processing '%s'\n", sopath.c_str());
109 
110  void *h = dlopen(sopath.c_str(), RTLD_LAZY);
111  if (!h) {
112  perror("dlopen failed");
113  exit(2);
114  }
115 
116  long long *p2f = (long long *)dlsym(h, "TrackerInfoCreator_ptr");
117  if (!p2f) {
118  perror("dlsym failed");
119  exit(2);
120  }
121 
122  std::string binpath = path + binname;
123  int binsr = stat(binpath.c_str(), &st);
124  printf("execTrackerInfoCreatorPlugin has%s found TrackerInfo binary file '%s'\n",
125  binsr ? " NOT" : "",
126  binpath.c_str());
127  if (binsr == 0)
128  ti.read_bin_file(binpath);
129 
130  TrackerInfoCreator_foo foo = (TrackerInfoCreator_foo)(*p2f);
131  foo(ti, ii, verbose);
132 
133  return;
134  }
135 
136  ++si;
137  }
138 
139  fprintf(stderr, "TrackerInfo plugin '%s' not found in search path.\n", soname.c_str());
140  exit(2);
141  }
bool verbose
ii
Definition: cuy.py:589
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def exit(msg="")

◆ findSeedsByRoadSearch()

void mkfit::findSeedsByRoadSearch ( TripletIdxConVec &  seed_idcs,
std::vector< LayerOfHits > &  evt_lay_hits,
int  lay1_size,
Event *&  ev 
)

Definition at line 34 of file seedtestMPlex.cc.

References a, funct::abs(), b, debug, mkfit::Config::dEtaSeedTrip, dprint, makeMEIFBenchmarkPlots::ev, JetChargeProducer_cfi::exp, f, getHypot(), getPhi(), getRad2(), mps_fire::i, heavyIonCSV_trainingSettings::idx, intersectThirdLayer(), mkfit::Config::lay01angdiff, SiStripPI::max, mkfit::Config::maxCurvR, mkfit::Hit::mcTrackID(), HLTObjectMonitor_cfi::mr, TtSemiLepEvtBuilder_cfi::mt, mkfit::Config::numHitsPerTask, mkfit::Hit::phi(), mkfit::LayerOfHits::refHit(), mkfit::Config::seed_d0cut, mkfit::Config::seed_z0cut, mkfit::Config::seed_z1cut, mathSSE::sqrt(), funct::tan(), mkfit::Hit::x(), mkfit::Hit::y(), and mkfit::Hit::z().

37  {
38 #ifdef DEBUG
39  bool debug(false);
40 #endif
41 
42  // MIMI hack: Config::nlayers_per_seed = 4
43  // const float seed_z2cut = (Config::nlayers_per_seed * Config::fRadialSpacing) / std::tan(2.0f*std::atan(std::exp(-1.0f*Config::dEtaSeedTrip)));
44 #ifdef DEBUG
45  const float seed_z2cut =
46  (4 * Config::fRadialSpacing) / std::tan(2.0f * std::atan(std::exp(-1.0f * Config::dEtaSeedTrip)));
47 #endif
48 
49  // 0 = first layer, 1 = second layer, 2 = third layer
50  const LayerOfHits& lay1_hits = evt_lay_hits[1];
51  LayerOfHits& lay0_hits = evt_lay_hits[0];
52  LayerOfHits& lay2_hits = evt_lay_hits[2];
53 
54  tbb::parallel_for(
55  tbb::blocked_range<int>(0, lay1_size, std::max(1, Config::numHitsPerTask)),
56  [&](const tbb::blocked_range<int>& i) {
57  TripletIdxVec temp_thr_seed_idcs;
58  for (int ihit1 = i.begin(); ihit1 < i.end(); ++ihit1) {
59  const Hit& hit1 = lay1_hits.refHit(ihit1);
60  const float hit1_z = hit1.z();
61 
62  dprint("ihit1: " << ihit1 << " mcTrackID: " << hit1.mcTrackID(ev->simHitsInfo_) << " phi: " << hit1.phi()
63  << " z: " << hit1.z());
64  dprint(" predphi: " << hit1.phi() << "+/-" << Config::lay01angdiff << " predz: " << hit1.z() / 2.0f << "+/-"
65  << Config::seed_z0cut / 2.0f << std::endl);
66 
67  std::vector<int> cand_hit0_indices; // pass by reference
68  // MIMI lay0_hits.selectHitIndices(hit1_z/2.0f,hit1.phi(),Config::seed_z0cut/2.0f,Config::lay01angdiff,cand_hit0_indices,true,false);
69  // loop over first layer hits
70  for (auto&& ihit0 : cand_hit0_indices) {
71  const Hit& hit0 = lay0_hits.refHit(ihit0);
72  const float hit0_z = hit0.z();
73  const float hit0_x = hit0.x();
74  const float hit0_y = hit0.y();
75  const float hit1_x = hit1.x();
76  const float hit1_y = hit1.y();
77  const float hit01_r2 = getRad2(hit0_x - hit1_x, hit0_y - hit1_y);
78 
79  const float quad = std::sqrt((4.0f * Config::maxCurvR * Config::maxCurvR - hit01_r2) / hit01_r2);
80 
81  // center of negative curved track
82  const float aneg = 0.5f * ((hit0_x + hit1_x) - (hit0_y - hit1_y) * quad);
83  const float bneg = 0.5f * ((hit0_y + hit1_y) + (hit0_x - hit1_x) * quad);
84 
85  // negative points of intersection with third layer
86  float lay2_negx = 0.0f, lay2_negy = 0.0f;
87  intersectThirdLayer(aneg, bneg, hit1_x, hit1_y, lay2_negx, lay2_negy);
88 #ifdef DEBUG
89  const float lay2_negphi = getPhi(lay2_negx, lay2_negy);
90 #endif
91 
92  // center of positive curved track
93  const float apos = 0.5f * ((hit0_x + hit1_x) + (hit0_y - hit1_y) * quad);
94  const float bpos = 0.5f * ((hit0_y + hit1_y) - (hit0_x - hit1_x) * quad);
95 
96  // positive points of intersection with third layer
97  float lay2_posx = 0.0f, lay2_posy = 0.0f;
98  intersectThirdLayer(apos, bpos, hit1_x, hit1_y, lay2_posx, lay2_posy);
99 #ifdef DEBUG
100  const float lay2_posphi = getPhi(lay2_posx, lay2_posy);
101 #endif
102 
103  std::vector<int> cand_hit2_indices;
104  // MIMI lay2_hits.selectHitIndices((2.0f*hit1_z-hit0_z),(lay2_posphi+lay2_negphi)/2.0f,
105  // MIMI seed_z2cut,(lay2_posphi-lay2_negphi)/2.0f,
106  // MIMI cand_hit2_indices,true,false);
107 
108  dprint(" ihit0: " << ihit0 << " mcTrackID: " << hit0.mcTrackID(ev->simHitsInfo_) << " phi: " << hit0.phi()
109  << " z: " << hit0.z());
110  dprint(" predphi: " << (lay2_posphi + lay2_negphi) / 2.0f << "+/-" << (lay2_posphi - lay2_negphi) / 2.0f
111  << " predz: " << 2.0f * hit1_z - hit0_z << "+/-" << seed_z2cut << std::endl);
112 
113  // loop over candidate third layer hits
114  //temp_thr_seed_idcs.reserve(temp_thr_seed_idcs.size()+cand_hit2_indices.size());
115 #pragma omp simd
116  for (size_t idx = 0; idx < cand_hit2_indices.size(); ++idx) {
117  const int ihit2 = cand_hit2_indices[idx];
118  const Hit& hit2 = lay2_hits.refHit(ihit2);
119 
120  const float lay1_predz = (hit0_z + hit2.z()) / 2.0f;
121  // filter by residual of second layer hit
122  if (std::abs(lay1_predz - hit1_z) > Config::seed_z1cut)
123  continue;
124 
125  const float hit2_x = hit2.x();
126  const float hit2_y = hit2.y();
127 
128  // now fit a circle, extract pT and d0 from center and radius
129  const float mr = (hit1_y - hit0_y) / (hit1_x - hit0_x);
130  const float mt = (hit2_y - hit1_y) / (hit2_x - hit1_x);
131  const float a = (mr * mt * (hit2_y - hit0_y) + mr * (hit1_x + hit2_x) - mt * (hit0_x + hit1_x)) /
132  (2.0f * (mr - mt));
133  const float b = -1.0f * (a - (hit0_x + hit1_x) / 2.0f) / mr + (hit0_y + hit1_y) / 2.0f;
134  const float r = getHypot(hit0_x - a, hit0_y - b);
135 
136  // filter by d0 cut 5mm, pT cut 0.5 GeV (radius of 0.5 GeV track)
138  continue;
139 
140  dprint(" ihit2: " << ihit2 << " mcTrackID: " << hit2.mcTrackID(ev->simHitsInfo_)
141  << " phi: " << hit2.phi() << " z: " << hit2.z());
142 
143  temp_thr_seed_idcs.emplace_back(TripletIdx{{ihit0, ihit1, ihit2}});
144  } // end loop over third layer matches
145  } // end loop over first layer matches
146  } // end chunk of hits for parallel for
147  seed_idcs.grow_by(temp_thr_seed_idcs.begin(), temp_thr_seed_idcs.end());
148  }); // end parallel for loop over second layer hits
149  }
constexpr float dEtaSeedTrip
double z
global z - AlignmentGeometry::z0, mm
Definition: HitCollection.h:27
constexpr float lay01angdiff
void intersectThirdLayer(const float a, const float b, const float hit1_x, const float hit1_y, float &lay2_x, float &lay2_y)
Definition: seedtestMPlex.cc:9
std::array< int, 3 > TripletIdx
Definition: TrackExtra.h:41
constexpr float seed_d0cut
T sqrt(T t)
Definition: SSEVec.h:23
float getRad2(float x, float y)
Definition: Hit.h:30
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
float getHypot(float x, float y)
Definition: Hit.h:47
#define debug
Definition: HDRShower.cc:19
constexpr float seed_z1cut
double b
Definition: hdecay.h:120
float getPhi(float x, float y)
Definition: Hit.h:34
#define dprint(x)
Definition: Debug.h:95
double a
Definition: hdecay.h:121
constexpr float seed_z0cut
constexpr float maxCurvR
std::vector< TripletIdx > TripletIdxVec
Definition: TrackExtra.h:42

◆ from_json() [1/12]

void mkfit::from_json ( const nlohmann::json nlohmann_json_j,
mkfit::LayerControl nlohmann_json_t 
)
inline

◆ from_json() [2/12]

void mkfit::from_json ( const nlohmann::ordered_json &  nlohmann_json_j,
mkfit::LayerControl nlohmann_json_t 
)
inline

Definition at line 37 of file IterationConfig.cc.

◆ from_json() [3/12]

void mkfit::from_json ( const nlohmann::json nlohmann_json_j,
mkfit::SteeringParams nlohmann_json_t 
)
inline

Definition at line 45 of file IterationConfig.cc.

◆ from_json() [4/12]

void mkfit::from_json ( const nlohmann::ordered_json &  nlohmann_json_j,
mkfit::SteeringParams nlohmann_json_t 
)
inline

Definition at line 45 of file IterationConfig.cc.

◆ from_json() [5/12]

void mkfit::from_json ( const nlohmann::json nlohmann_json_j,
mkfit::IterationLayerConfig nlohmann_json_t 
)
inline

Definition at line 54 of file IterationConfig.cc.

◆ from_json() [6/12]

void mkfit::from_json ( const nlohmann::ordered_json &  nlohmann_json_j,
mkfit::IterationLayerConfig nlohmann_json_t 
)
inline

Definition at line 54 of file IterationConfig.cc.

◆ from_json() [7/12]

void mkfit::from_json ( const nlohmann::json nlohmann_json_j,
mkfit::IterationParams nlohmann_json_t 
)
inline

Definition at line 68 of file IterationConfig.cc.

◆ from_json() [8/12]

void mkfit::from_json ( const nlohmann::ordered_json &  nlohmann_json_j,
mkfit::IterationParams nlohmann_json_t 
)
inline

Definition at line 68 of file IterationConfig.cc.

◆ from_json() [9/12]

void mkfit::from_json ( const nlohmann::json nlohmann_json_j,
mkfit::IterationConfig nlohmann_json_t 
)
inline

Definition at line 101 of file IterationConfig.cc.

◆ from_json() [10/12]

void mkfit::from_json ( const nlohmann::ordered_json &  nlohmann_json_j,
mkfit::IterationConfig nlohmann_json_t 
)
inline

Definition at line 101 of file IterationConfig.cc.

◆ from_json() [11/12]

void mkfit::from_json ( const nlohmann::json nlohmann_json_j,
mkfit::IterationsInfo nlohmann_json_t 
)
inline

Definition at line 104 of file IterationConfig.cc.

110 {

◆ from_json() [12/12]

void mkfit::from_json ( const nlohmann::ordered_json &  nlohmann_json_j,
mkfit::IterationsInfo nlohmann_json_t 
)
inline

Definition at line 104 of file IterationConfig.cc.

110 {

◆ getEta() [1/3]

float mkfit::getEta ( float  r,
float  z 
)
inline

◆ getEta() [2/3]

float mkfit::getEta ( float  theta)
inline

Definition at line 40 of file Hit.h.

References f, dqm-mbProfile::log, funct::tan(), and theta().

40 { return -1.0f * std::log(std::tan(theta / 2.0f)); }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double f[11][100]
Geom::Theta< T > theta() const

◆ getEta() [3/3]

float mkfit::getEta ( float  x,
float  y,
float  z 
)
inline

Definition at line 42 of file Hit.h.

References f, dqm-mbProfile::log, mathSSE::sqrt(), funct::tan(), theta(), and x.

42  {
43  const float theta = std::atan2(std::sqrt(x * x + y * y), z);
44  return -1.0f * std::log(std::tan(theta / 2.0f));
45  }
float float float z
T sqrt(T t)
Definition: SSEVec.h:23
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double f[11][100]
float x
Geom::Theta< T > theta() const

◆ getEtaErr2()

float mkfit::getEtaErr2 ( float  x,
float  y,
float  z,
float  exx,
float  eyy,
float  ezz,
float  exy,
float  exz,
float  eyz 
)
inline

Definition at line 74 of file Hit.h.

References getRad2(), mathSSE::sqrt(), and x.

Referenced by mkfit::Hit::eeta(), and mkfit::TrackState::eposEta().

74  {
75  const float rad2 = getRad2(x, y);
76  const float detadx = -x / (rad2 * std::sqrt(1 + rad2 / (z * z)));
77  const float detady = -y / (rad2 * std::sqrt(1 + rad2 / (z * z)));
78  const float detadz = 1.0f / (z * std::sqrt(1 + rad2 / (z * z)));
79  return detadx * detadx * exx + detady * detady * eyy + detadz * detadz * ezz + 2.0f * detadx * detady * exy +
80  2.0f * detadx * detadz * exz + 2.0f * detady * detadz * eyz;
81  }
float float float z
T sqrt(T t)
Definition: SSEVec.h:23
float getRad2(float x, float y)
Definition: Hit.h:30
float x

◆ getHypot()

float mkfit::getHypot ( float  x,
float  y 
)
inline

Definition at line 47 of file Hit.h.

References mathSSE::sqrt(), and x.

Referenced by findSeedsByRoadSearch(), intersectThirdLayer(), mkfit::TrackState::posR(), mkfit::TrackBase::posR(), and mkfit::TrackBase::swimPhiToR().

47 { return std::sqrt(x * x + y * y); }
T sqrt(T t)
Definition: SSEVec.h:23
float x

◆ getInvRad2()

float mkfit::getInvRad2 ( float  x,
float  y 
)
inline

Definition at line 32 of file Hit.h.

References x.

32 { return 1.0f / (x * x + y * y); }
float x

◆ getInvRadErr2()

float mkfit::getInvRadErr2 ( float  x,
float  y,
float  exx,
float  eyy,
float  exy 
)
inline

Definition at line 53 of file Hit.h.

References cube(), f, getRad2(), and x.

53  {
54  return (x * x * exx + y * y * eyy + 2.0f * x * y * exy) / cube(getRad2(x, y));
55  }
float getRad2(float x, float y)
Definition: Hit.h:30
double f[11][100]
T cube(T x)
Definition: Hit.h:18
float x

◆ getMatchBin()

int mkfit::getMatchBin ( const float  pt)
inline

Definition at line 237 of file TrackExtra.cc.

References f, and DiDispStaMuonMonitor_cfi::pt.

Referenced by mkfit::TrackExtra::setCMSSWTrackIDInfoByTrkParams().

237  {
238  if (pt < 0.75f)
239  return 0;
240  else if (pt < 1.f)
241  return 1;
242  else if (pt < 2.f)
243  return 2;
244  else if (pt < 5.f)
245  return 3;
246  else if (pt < 10.f)
247  return 4;
248  else
249  return 5;
250  }
double f[11][100]

◆ getPhi()

float mkfit::getPhi ( float  x,
float  y 
)
inline

◆ getPhiErr2()

float mkfit::getPhiErr2 ( float  x,
float  y,
float  exx,
float  eyy,
float  exy 
)
inline

Definition at line 57 of file Hit.h.

References f, getRad2(), and x.

Referenced by mkfit::Hit::ephi(), and mkfit::TrackState::eposPhi().

57  {
58  const float rad2 = getRad2(x, y);
59  return (y * y * exx + x * x * eyy - 2.0f * x * y * exy) / (rad2 * rad2);
60  }
float getRad2(float x, float y)
Definition: Hit.h:30
double f[11][100]
float x

◆ getPxPxErr2()

float mkfit::getPxPxErr2 ( float  ipt,
float  phi,
float  vipt,
float  vphi 
)
inline

Definition at line 83 of file Hit.h.

References funct::cos(), and funct::sin().

Referenced by mkfit::TrackState::epxpx().

83  { // ipt = 1/pT, v = variance
84  const float iipt2 = 1.0f / (ipt * ipt); //iipt = 1/(1/pT) = pT
85  const float cosP = std::cos(phi);
86  const float sinP = std::sin(phi);
87  return iipt2 * (iipt2 * cosP * cosP * vipt + sinP * sinP * vphi);
88  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22

◆ getPyPyErr2()

float mkfit::getPyPyErr2 ( float  ipt,
float  phi,
float  vipt,
float  vphi 
)
inline

Definition at line 90 of file Hit.h.

References funct::cos(), and funct::sin().

Referenced by mkfit::TrackState::epypy(), and mkfit::TrackState::epzpz().

90  { // ipt = 1/pT, v = variance
91  const float iipt2 = 1.0f / (ipt * ipt); //iipt = 1/(1/pT) = pT
92  const float cosP = std::cos(phi);
93  const float sinP = std::sin(phi);
94  return iipt2 * (iipt2 * sinP * sinP * vipt + cosP * cosP * vphi);
95  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22

◆ getPzPzErr2()

float mkfit::getPzPzErr2 ( float  ipt,
float  theta,
float  vipt,
float  vtheta 
)
inline

Definition at line 97 of file Hit.h.

References funct::sin(), funct::tan(), and theta().

97  { // ipt = 1/pT, v = variance
98  const float iipt2 = 1.0f / (ipt * ipt); //iipt = 1/(1/pT) = pT
99  const float cotT = 1.0f / std::tan(theta);
100  const float cscT = 1.0f / std::sin(theta);
101  return iipt2 * (iipt2 * cotT * cotT * vipt + cscT * cscT * cscT * cscT * vtheta);
102  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Geom::Theta< T > theta() const

◆ getRad2()

float mkfit::getRad2 ( float  x,
float  y 
)
inline

Definition at line 30 of file Hit.h.

References x.

Referenced by conformalFitMPlex(), findSeedsByRoadSearch(), getEtaErr2(), getInvRadErr2(), getPhiErr2(), getRadErr2(), and getThetaErr2().

30 { return x * x + y * y; }
float x

◆ getRadErr2()

float mkfit::getRadErr2 ( float  x,
float  y,
float  exx,
float  eyy,
float  exy 
)
inline

Definition at line 49 of file Hit.h.

References f, getRad2(), and x.

Referenced by mkfit::TrackState::eposR().

49  {
50  return (x * x * exx + y * y * eyy + 2.0f * x * y * exy) / getRad2(x, y);
51  }
float getRad2(float x, float y)
Definition: Hit.h:30
double f[11][100]
float x

◆ getScoreCand() [1/2]

float mkfit::getScoreCand ( const track_score_func score_func,
const TrackCand cand1,
bool  penalizeTailMissHits = false,
bool  inFindCandidates = false 
)
inline

Definition at line 259 of file TrackStructures.h.

References mkfit::TrackBase::chi2(), nano_mu_local_reco_cff::chi2, mkfit::TrackCand::nFoundHits(), mkfit::TrackCand::nInsideMinusOneHits(), mkfit::TrackCand::nOverlapHits(), mkfit::TrackCand::nTailMinusOneHits(), DiDispStaMuonMonitor_cfi::pt, and mkfit::TrackBase::pT().

262  {
263  int nfoundhits = cand1.nFoundHits();
264  int noverlaphits = cand1.nOverlapHits();
265  int nmisshits = cand1.nInsideMinusOneHits();
266  int ntailmisshits = penalizeTailMissHits ? cand1.nTailMinusOneHits() : 0;
267  float pt = cand1.pT();
268  float chi2 = cand1.chi2();
269  // Do not allow for chi2<0 in score calculation
270  if (chi2 < 0)
271  chi2 = 0.f;
272  return score_func(nfoundhits, ntailmisshits, noverlaphits, nmisshits, chi2, pt, inFindCandidates);
273  }

◆ getScoreCand() [2/2]

float mkfit::getScoreCand ( const track_score_func score_func,
const Track cand1,
bool  penalizeTailMissHits = false,
bool  inFindCandidates = false 
)
inline

Definition at line 601 of file Track.h.

References mkfit::TrackBase::chi2(), nano_mu_local_reco_cff::chi2, mkfit::Track::nFoundHits(), mkfit::Track::nInsideMinusOneHits(), mkfit::Track::nOverlapHits(), mkfit::Track::nTailMinusOneHits(), DiDispStaMuonMonitor_cfi::pt, and mkfit::TrackBase::pT().

Referenced by mkfit::MkFinder::bkFitOutputTracks(), mkfit::MkBuilder::find_tracks_in_layers(), mkfit::MkFinder::findCandidates(), mkfit::CombCandidate::importSeed(), mkfit::CombCandidate::mergeCandsAndBestShortOne(), mkfit::Event::print_tracks(), mkfit::StdSeq::score_tracks(), and mkfit::TTreeValidation::setTrackScoresDumbCMSSW().

604  {
605  int nfoundhits = cand1.nFoundHits();
606  int noverlaphits = cand1.nOverlapHits();
607  int nmisshits = cand1.nInsideMinusOneHits();
608  float ntailmisshits = penalizeTailMissHits ? cand1.nTailMinusOneHits() : 0;
609  float pt = cand1.pT();
610  float chi2 = cand1.chi2();
611  // Do not allow for chi2<0 in score calculation
612  if (chi2 < 0)
613  chi2 = 0.f;
614  return score_func(nfoundhits, ntailmisshits, noverlaphits, nmisshits, chi2, pt, inFindCandidates);
615  }

◆ getScoreStruct()

float mkfit::getScoreStruct ( const track_score_func score_func,
const IdxChi2List cand1 
)
inline

Definition at line 617 of file Track.h.

References mkfit::IdxChi2List::chi2, nano_mu_local_reco_cff::chi2, mkfit::IdxChi2List::nhits, mkfit::IdxChi2List::nholes, mkfit::IdxChi2List::noverlaps, mkfit::IdxChi2List::ntailholes, mkfit::IdxChi2List::pt, and DiDispStaMuonMonitor_cfi::pt.

Referenced by mkfit::MkFinder::findCandidatesCloneEngine().

617  {
618  int nfoundhits = cand1.nhits;
619  int ntailholes = cand1.ntailholes;
620  int noverlaphits = cand1.noverlaps;
621  int nmisshits = cand1.nholes;
622  float pt = cand1.pt;
623  float chi2 = cand1.chi2;
624  // Do not allow for chi2<0 in score calculation
625  if (chi2 < 0)
626  chi2 = 0.f;
627  return score_func(nfoundhits, ntailholes, noverlaphits, nmisshits, chi2, pt, true /*inFindCandidates*/);
628  }

◆ getScoreWorstPossible()

float mkfit::getScoreWorstPossible ( )
inline

Definition at line 597 of file Track.h.

References SiStripPI::max.

Referenced by mkfit::CombCandidate::reset(), and mkfit::TrackCand::resetShortTrack().

597  {
598  return -std::numeric_limits<float>::max(); // used for handling of best short track during finding
599  }

◆ getTheta()

float mkfit::getTheta ( float  r,
float  z 
)
inline

◆ getThetaErr2()

float mkfit::getThetaErr2 ( float  x,
float  y,
float  z,
float  exx,
float  eyy,
float  ezz,
float  exy,
float  exz,
float  eyz 
)
inline

Definition at line 62 of file Hit.h.

References getRad2(), mathSSE::sqrt(), and x.

63  {
64  const float rad2 = getRad2(x, y);
65  const float rad = std::sqrt(rad2);
66  const float hypot2 = rad2 + z * z;
67  const float dthetadx = x * z / (rad * hypot2);
68  const float dthetady = y * z / (rad * hypot2);
69  const float dthetadz = -rad / hypot2;
70  return dthetadx * dthetadx * exx + dthetady * dthetady * eyy + dthetadz * dthetadz * ezz +
71  2.0f * dthetadx * dthetady * exy + 2.0f * dthetadx * dthetadz * exz + 2.0f * dthetady * dthetadz * eyz;
72  }
float float float z
T sqrt(T t)
Definition: SSEVec.h:23
float getRad2(float x, float y)
Definition: Hit.h:30
float x

◆ helixAtPlane()

void mkfit::helixAtPlane ( const MPlexLV inPar,
const MPlexQI inChg,
const MPlexHV plPnt,
const MPlexHV plNrm,
MPlexQF pathL,
MPlexLV outPar,
MPlexLL errorProp,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags pflags 
)

Definition at line 1074 of file PropagationMPlex.cc.

References f, and NN.

Referenced by propagateHelixToPlaneMPlex().

1083  {
1084  errorProp.setVal(0.f);
1085  outFailFlag.setVal(0.f);
1086 
1087  helixAtPlane_impl(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, 0, NN, N_proc, pflags);
1088  }
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
double f[11][100]

◆ helixAtRFromIterativeCCS()

void mkfit::helixAtRFromIterativeCCS ( const MPlexLV inPar,
const MPlexQI inChg,
const MPlexQF msRad,
MPlexLV outPar,
MPlexLL errorProp,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags pflags 
)

Definition at line 484 of file PropagationMPlex.cc.

References f, and NN.

Referenced by propagateHelixToRMPlex().

491  {
492  errorProp.setVal(0.f);
493  outFailFlag.setVal(0.f);
494 
495  helixAtRFromIterativeCCS_impl(inPar, inChg, msRad, outPar, errorProp, outFailFlag, 0, NN, N_proc, pflags);
496  }
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
double f[11][100]

◆ helixAtRFromIterativeCCSFullJac() [1/2]

void mkfit::helixAtRFromIterativeCCSFullJac ( const MPlexLV inPar,
const MPlexQI inChg,
const MPlexQF msRad,
MPlexLV outPar,
MPlexLL errorProp,
MPlexQI outFailFlag,
const int  N_proc 
)

◆ helixAtRFromIterativeCCSFullJac() [2/2]

void mkfit::helixAtRFromIterativeCCSFullJac ( const MPlexLV inPar,
const MPlexQI inChg,
const MPlexQF msRad,
MPlexLV outPar,
MPlexLL errorProp,
const int  N_proc 
)

Definition at line 296 of file PropagationMPlex.cc.

References funct::abs(), mkfit::Config::Bfield, CMS_UNROLL_LOOP_COUNT, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), funct::cos(), gather_cfg::cout, debug, dprint_np, f, g_debug, hipo(), mps_fire::i, dqmdumpme::k, dqmiodumpmetadata::n, mkfit::Config::Niter, NN, funct::sin(), sincos4(), mkfit::Const::sol, mathSSE::sqrt(), funct::tan(), theta(), and mkfit::Config::useTrigApprox.

301  {
302  errorProp.setVal(0.f);
303  MPlexLL errorPropTmp(0.f); //initialize to zero
304  MPlexLL errorPropSwap(0.f); //initialize to zero
305 
306  // loop does not vectorize with llvm16, and it issues a warning
307  // that apparently can't be suppressed with a pragma. Needs to
308  // be rechecked if future llvm versions improve vectorization.
309 #if !defined(__clang__)
310 #pragma omp simd
311 #endif
312  for (int n = 0; n < NN; ++n) {
313  //initialize erroProp to identity matrix
314  errorProp(n, 0, 0) = 1.f;
315  errorProp(n, 1, 1) = 1.f;
316  errorProp(n, 2, 2) = 1.f;
317  errorProp(n, 3, 3) = 1.f;
318  errorProp(n, 4, 4) = 1.f;
319  errorProp(n, 5, 5) = 1.f;
320 
321  const float k = inChg.constAt(n, 0, 0) * 100.f / (-Const::sol * Config::Bfield);
322  const float r = msRad.constAt(n, 0, 0);
323  float r0 = hipo(inPar.constAt(n, 0, 0), inPar.constAt(n, 1, 0));
324 
325  if (std::abs(r - r0) < 0.0001f) {
326  dprint_np(n, "distance less than 1mum, skip");
327  continue;
328  }
329 
330  const float ipt = inPar.constAt(n, 3, 0);
331  const float phiin = inPar.constAt(n, 4, 0);
332  const float theta = inPar.constAt(n, 5, 0);
333 
334  //set those that are 1. before iterations
335  errorPropTmp(n, 2, 2) = 1.f;
336  errorPropTmp(n, 3, 3) = 1.f;
337  errorPropTmp(n, 4, 4) = 1.f;
338  errorPropTmp(n, 5, 5) = 1.f;
339 
340  float cosah = 0., sinah = 0.;
341  //no trig approx here, phi and theta can be large
342  float cosP = std::cos(phiin), sinP = std::sin(phiin);
343  const float cosT = std::cos(theta), sinT = std::sin(theta);
344  float pxin = cosP / ipt;
345  float pyin = sinP / ipt;
346 
348  for (int i = 0; i < Config::Niter; ++i) {
349  dprint_np(n,
350  std::endl
351  << "attempt propagation from r=" << r0 << " to r=" << r << std::endl
352  << "x=" << outPar.At(n, 0, 0) << " y=" << outPar.At(n, 1, 0) << " z=" << outPar.At(n, 2, 0)
353  << " px=" << std::cos(phiin) / ipt << " py=" << std::sin(phiin) / ipt
354  << " pz=" << 1.f / (ipt * tan(theta)) << " q=" << inChg.constAt(n, 0, 0) << std::endl);
355 
356  r0 = hipo(outPar.constAt(n, 0, 0), outPar.constAt(n, 1, 0));
357  const float ialpha = (r - r0) * ipt / k;
358  //alpha+=ialpha;
359 
361  sincos4(ialpha * 0.5f, sinah, cosah);
362  } else {
363  cosah = std::cos(ialpha * 0.5f);
364  sinah = std::sin(ialpha * 0.5f);
365  }
366  const float cosa = 1.f - 2.f * sinah * sinah;
367  const float sina = 2.f * sinah * cosah;
368 
369  //derivatives of alpha
370  const float dadx = -outPar.At(n, 0, 0) * ipt / (k * r0);
371  const float dady = -outPar.At(n, 1, 0) * ipt / (k * r0);
372  const float dadipt = (r - r0) / k;
373 
374  outPar.At(n, 0, 0) = outPar.constAt(n, 0, 0) + 2.f * k * sinah * (pxin * cosah - pyin * sinah);
375  outPar.At(n, 1, 0) = outPar.constAt(n, 1, 0) + 2.f * k * sinah * (pyin * cosah + pxin * sinah);
376  const float pxinold = pxin; //copy before overwriting
377  pxin = pxin * cosa - pyin * sina;
378  pyin = pyin * cosa + pxinold * sina;
379 
380  //need phi at origin, so this goes before redefining phi
381  //no trig approx here, phi can be large
382  cosP = std::cos(outPar.At(n, 4, 0));
383  sinP = std::sin(outPar.At(n, 4, 0));
384 
385  outPar.At(n, 2, 0) = outPar.constAt(n, 2, 0) + k * ialpha * cosT / (ipt * sinT);
386  outPar.At(n, 3, 0) = ipt;
387  outPar.At(n, 4, 0) = outPar.constAt(n, 4, 0) + ialpha;
388  outPar.At(n, 5, 0) = theta;
389 
390  errorPropTmp(n, 0, 0) = 1.f + k * (cosP * dadx * cosa - sinP * dadx * sina) / ipt;
391  errorPropTmp(n, 0, 1) = k * (cosP * dady * cosa - sinP * dady * sina) / ipt;
392  errorPropTmp(n, 0, 3) =
393  k * (cosP * (ipt * dadipt * cosa - sina) + sinP * ((1.f - cosa) - ipt * dadipt * sina)) / (ipt * ipt);
394  errorPropTmp(n, 0, 4) = -k * (sinP * sina + cosP * (1.f - cosa)) / ipt;
395 
396  errorPropTmp(n, 1, 0) = k * (sinP * dadx * cosa + cosP * dadx * sina) / ipt;
397  errorPropTmp(n, 1, 1) = 1.f + k * (sinP * dady * cosa + cosP * dady * sina) / ipt;
398  errorPropTmp(n, 1, 3) =
399  k * (sinP * (ipt * dadipt * cosa - sina) + cosP * (ipt * dadipt * sina - (1.f - cosa))) / (ipt * ipt);
400  errorPropTmp(n, 1, 4) = k * (cosP * sina - sinP * (1.f - cosa)) / ipt;
401 
402  errorPropTmp(n, 2, 0) = k * cosT * dadx / (ipt * sinT);
403  errorPropTmp(n, 2, 1) = k * cosT * dady / (ipt * sinT);
404  errorPropTmp(n, 2, 3) = k * cosT * (ipt * dadipt - ialpha) / (ipt * ipt * sinT);
405  errorPropTmp(n, 2, 5) = -k * ialpha / (ipt * sinT * sinT);
406 
407  errorPropTmp(n, 4, 0) = dadx;
408  errorPropTmp(n, 4, 1) = dady;
409  errorPropTmp(n, 4, 3) = dadipt;
410 
411  MultHelixPropTemp(errorProp, errorPropTmp, errorPropSwap, n);
412  errorProp = errorPropSwap;
413  }
414 
415  dprint_np(
416  n,
417  "propagation end, dump parameters"
418  << std::endl
419  << "pos = " << outPar.At(n, 0, 0) << " " << outPar.At(n, 1, 0) << " " << outPar.At(n, 2, 0) << std::endl
420  << "mom = " << std::cos(outPar.At(n, 4, 0)) / outPar.At(n, 3, 0) << " "
421  << std::sin(outPar.At(n, 4, 0)) / outPar.At(n, 3, 0) << " "
422  << 1. / (outPar.At(n, 3, 0) * tan(outPar.At(n, 5, 0)))
423  << " r=" << std::sqrt(outPar.At(n, 0, 0) * outPar.At(n, 0, 0) + outPar.At(n, 1, 0) * outPar.At(n, 1, 0))
424  << " pT=" << 1. / std::abs(outPar.At(n, 3, 0)) << std::endl);
425 
426 #ifdef DEBUG
427  if (debug && g_debug && n < N_proc) {
428  dmutex_guard;
429  std::cout << n << " jacobian" << std::endl;
430  printf("%5f %5f %5f %5f %5f %5f\n",
431  errorProp(n, 0, 0),
432  errorProp(n, 0, 1),
433  errorProp(n, 0, 2),
434  errorProp(n, 0, 3),
435  errorProp(n, 0, 4),
436  errorProp(n, 0, 5));
437  printf("%5f %5f %5f %5f %5f %5f\n",
438  errorProp(n, 1, 0),
439  errorProp(n, 1, 1),
440  errorProp(n, 1, 2),
441  errorProp(n, 1, 3),
442  errorProp(n, 1, 4),
443  errorProp(n, 1, 5));
444  printf("%5f %5f %5f %5f %5f %5f\n",
445  errorProp(n, 2, 0),
446  errorProp(n, 2, 1),
447  errorProp(n, 2, 2),
448  errorProp(n, 2, 3),
449  errorProp(n, 2, 4),
450  errorProp(n, 2, 5));
451  printf("%5f %5f %5f %5f %5f %5f\n",
452  errorProp(n, 3, 0),
453  errorProp(n, 3, 1),
454  errorProp(n, 3, 2),
455  errorProp(n, 3, 3),
456  errorProp(n, 3, 4),
457  errorProp(n, 3, 5));
458  printf("%5f %5f %5f %5f %5f %5f\n",
459  errorProp(n, 4, 0),
460  errorProp(n, 4, 1),
461  errorProp(n, 4, 2),
462  errorProp(n, 4, 3),
463  errorProp(n, 4, 4),
464  errorProp(n, 4, 5));
465  printf("%5f %5f %5f %5f %5f %5f\n",
466  errorProp(n, 5, 0),
467  errorProp(n, 5, 1),
468  errorProp(n, 5, 2),
469  errorProp(n, 5, 3),
470  errorProp(n, 5, 4),
471  errorProp(n, 5, 5));
472  }
473 #endif
474  }
475  }
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
Definition: Matrix.h:48
#define dprint_np(n, x)
Definition: Debug.h:96
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define CMS_UNROLL_LOOP_COUNT(N)
Definition: CMSUnrollLoop.h:48
bool g_debug
Definition: Debug.cc:2
T sqrt(T t)
Definition: SSEVec.h:23
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:55
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
constexpr bool useTrigApprox
Definition: Config.h:50
#define debug
Definition: HDRShower.cc:19
constexpr float sol
Definition: Config.h:13
float hipo(float x, float y)
Definition: Matrix.h:9
void sincos4(const float x, float &sin, float &cos)
Definition: Matrix.h:13
Geom::Theta< T > theta() const
constexpr int Niter
Definition: Config.h:49

◆ helixAtZ()

void mkfit::helixAtZ ( const MPlexLV inPar,
const MPlexQI inChg,
const MPlexQF msZ,
MPlexLV outPar,
MPlexLL errorProp,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags pflags 
)

Definition at line 752 of file PropagationMPlex.cc.

References funct::abs(), simBeamSpotPI::alpha, mkfit::Config::Bfield, mkfit::Config::bFieldFromZR(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), funct::cos(), gather_cfg::cout, debug, l1tTrackerHTMiss_cfi::deltaZ, dprint_np, f, g_debug, hipo(), dqmdumpme::k, dqmiodumpmetadata::n, NN, DiDispStaMuonMonitor_cfi::pt, funct::sin(), sincos4(), mkfit::Const::sol, mathSSE::sqrt(), funct::tan(), theta(), mkfit::PropagationFlags::use_param_b_field, and mkfit::Config::useTrigApprox.

Referenced by propagateHelixToZMPlex().

759  {
760  errorProp.setVal(0.f);
761  outFailFlag.setVal(0.f);
762 
763  // debug = true;
764 #pragma omp simd
765  for (int n = 0; n < NN; ++n) {
766  //initialize erroProp to identity matrix, except element 2,2 which is zero
767  errorProp(n, 0, 0) = 1.f;
768  errorProp(n, 1, 1) = 1.f;
769  errorProp(n, 3, 3) = 1.f;
770  errorProp(n, 4, 4) = 1.f;
771  errorProp(n, 5, 5) = 1.f;
772  }
773  float zout[NN];
774  float zin[NN];
775  float ipt[NN];
776  float phiin[NN];
777  float theta[NN];
778 #pragma omp simd
779  for (int n = 0; n < NN; ++n) {
780  //initialize erroProp to identity matrix, except element 2,2 which is zero
781  zout[n] = msZ.constAt(n, 0, 0);
782  zin[n] = inPar.constAt(n, 2, 0);
783  ipt[n] = inPar.constAt(n, 3, 0);
784  phiin[n] = inPar.constAt(n, 4, 0);
785  theta[n] = inPar.constAt(n, 5, 0);
786  }
787 
788  float k[NN];
789  if (pflags.use_param_b_field) {
790 #pragma omp simd
791  for (int n = 0; n < NN; ++n) {
792  k[n] = inChg.constAt(n, 0, 0) * 100.f /
793  (-Const::sol * Config::bFieldFromZR(zin[n], hipo(inPar.constAt(n, 0, 0), inPar.constAt(n, 1, 0))));
794  }
795  } else {
796 #pragma omp simd
797  for (int n = 0; n < NN; ++n) {
798  k[n] = inChg.constAt(n, 0, 0) * 100.f / (-Const::sol * Config::Bfield);
799  }
800  }
801 
802  float kinv[NN];
803 #pragma omp simd
804  for (int n = 0; n < NN; ++n) {
805  kinv[n] = 1.f / k[n];
806  }
807 
808 #pragma omp simd
809  for (int n = 0; n < NN; ++n) {
810  dprint_np(n,
811  std::endl
812  << "input parameters"
813  << " inPar.constAt(n, 0, 0)=" << std::setprecision(9) << inPar.constAt(n, 0, 0)
814  << " inPar.constAt(n, 1, 0)=" << std::setprecision(9) << inPar.constAt(n, 1, 0)
815  << " inPar.constAt(n, 2, 0)=" << std::setprecision(9) << inPar.constAt(n, 2, 0)
816  << " inPar.constAt(n, 3, 0)=" << std::setprecision(9) << inPar.constAt(n, 3, 0)
817  << " inPar.constAt(n, 4, 0)=" << std::setprecision(9) << inPar.constAt(n, 4, 0)
818  << " inPar.constAt(n, 5, 0)=" << std::setprecision(9) << inPar.constAt(n, 5, 0)
819  << " inChg.constAt(n, 0, 0)=" << std::setprecision(9) << inChg.constAt(n, 0, 0));
820  }
821 #pragma omp simd
822  for (int n = 0; n < NN; ++n) {
823  dprint_np(n,
824  "propagation start, dump parameters"
825  << std::endl
826  << "pos = " << inPar.constAt(n, 0, 0) << " " << inPar.constAt(n, 1, 0) << " "
827  << inPar.constAt(n, 2, 0) << std::endl
828  << "mom (cart) = " << std::cos(inPar.constAt(n, 4, 0)) / inPar.constAt(n, 3, 0) << " "
829  << std::sin(inPar.constAt(n, 4, 0)) / inPar.constAt(n, 3, 0) << " "
830  << 1. / (inPar.constAt(n, 3, 0) * tan(inPar.constAt(n, 5, 0))) << " r="
831  << std::sqrt(inPar.constAt(n, 0, 0) * inPar.constAt(n, 0, 0) +
832  inPar.constAt(n, 1, 0) * inPar.constAt(n, 1, 0))
833  << " pT=" << 1. / std::abs(inPar.constAt(n, 3, 0)) << " q=" << inChg.constAt(n, 0, 0)
834  << " targetZ=" << msZ.constAt(n, 0, 0) << std::endl);
835  }
836 
837  float pt[NN];
838 #pragma omp simd
839  for (int n = 0; n < NN; ++n) {
840  pt[n] = 1.f / ipt[n];
841  }
842 
843  //no trig approx here, phi can be large
844  float cosP[NN];
845  float sinP[NN];
846 #pragma omp simd
847  for (int n = 0; n < NN; ++n) {
848  cosP[n] = std::cos(phiin[n]);
849  }
850 
851 #pragma omp simd
852  for (int n = 0; n < NN; ++n) {
853  sinP[n] = std::sin(phiin[n]);
854  }
855 
856  float cosT[NN];
857  float sinT[NN];
858 #pragma omp simd
859  for (int n = 0; n < NN; ++n) {
860  cosT[n] = std::cos(theta[n]);
861  }
862 
863 #pragma omp simd
864  for (int n = 0; n < NN; ++n) {
865  sinT[n] = std::sin(theta[n]);
866  }
867 
868  float tanT[NN];
869  float icos2T[NN];
870  float pxin[NN];
871  float pyin[NN];
872 #pragma omp simd
873  for (int n = 0; n < NN; ++n) {
874  tanT[n] = sinT[n] / cosT[n];
875  icos2T[n] = 1.f / (cosT[n] * cosT[n]);
876  pxin[n] = cosP[n] * pt[n];
877  pyin[n] = sinP[n] * pt[n];
878  }
879 
880  float deltaZ[NN];
881  float alpha[NN];
882 #pragma omp simd
883  for (int n = 0; n < NN; ++n) {
884  deltaZ[n] = zout[n] - zin[n];
885  alpha[n] = deltaZ[n] * tanT[n] * ipt[n] * kinv[n];
886  }
887 
888  float cosahTmp[NN];
889  float sinahTmp[NN];
891 #if !defined(__INTEL_COMPILER)
892 #pragma omp simd
893 #endif
894  for (int n = 0; n < NN; ++n) {
895  sincos4(alpha[n] * 0.5f, sinahTmp[n], cosahTmp[n]);
896  }
897  } else {
898 #if !defined(__INTEL_COMPILER)
899 #pragma omp simd
900 #endif
901  for (int n = 0; n < NN; ++n) {
902  cosahTmp[n] = std::cos(alpha[n] * 0.5f);
903  }
904 #if !defined(__INTEL_COMPILER)
905 #pragma omp simd
906 #endif
907  for (int n = 0; n < NN; ++n) {
908  sinahTmp[n] = std::sin(alpha[n] * 0.5f);
909  }
910  }
911 
912  float cosah[NN];
913  float sinah[NN];
914  float cosa[NN];
915  float sina[NN];
916 #pragma omp simd
917  for (int n = 0; n < NN; ++n) {
918  cosah[n] = cosahTmp[n];
919  sinah[n] = sinahTmp[n];
920  cosa[n] = 1.f - 2.f * sinah[n] * sinah[n];
921  sina[n] = 2.f * sinah[n] * cosah[n];
922  }
923 
924 //update parameters
925 #pragma omp simd
926  for (int n = 0; n < NN; ++n) {
927  outPar.At(n, 0, 0) = outPar.At(n, 0, 0) + 2.f * k[n] * sinah[n] * (pxin[n] * cosah[n] - pyin[n] * sinah[n]);
928  outPar.At(n, 1, 0) = outPar.At(n, 1, 0) + 2.f * k[n] * sinah[n] * (pyin[n] * cosah[n] + pxin[n] * sinah[n]);
929  outPar.At(n, 2, 0) = zout[n];
930  outPar.At(n, 4, 0) = phiin[n] + alpha[n];
931  }
932 
933 #pragma omp simd
934  for (int n = 0; n < NN; ++n) {
935  dprint_np(n,
936  "propagation to Z end (OLD), dump parameters\n"
937  << " pos = " << outPar(n, 0, 0) << " " << outPar(n, 1, 0) << " " << outPar(n, 2, 0) << "\t\t r="
938  << std::sqrt(outPar(n, 0, 0) * outPar(n, 0, 0) + outPar(n, 1, 0) * outPar(n, 1, 0)) << std::endl
939  << " mom = " << outPar(n, 3, 0) << " " << outPar(n, 4, 0) << " " << outPar(n, 5, 0) << std::endl
940  << " cart= " << std::cos(outPar(n, 4, 0)) / outPar(n, 3, 0) << " "
941  << std::sin(outPar(n, 4, 0)) / outPar(n, 3, 0) << " "
942  << 1. / (outPar(n, 3, 0) * tan(outPar(n, 5, 0))) << "\t\tpT=" << 1. / std::abs(outPar(n, 3, 0))
943  << std::endl);
944  }
945 
946  float pxcaMpysa[NN];
947 #pragma omp simd
948  for (int n = 0; n < NN; ++n) {
949  pxcaMpysa[n] = pxin[n] * cosa[n] - pyin[n] * sina[n];
950  }
951 
952 #pragma omp simd
953  for (int n = 0; n < NN; ++n) {
954  errorProp(n, 0, 2) = -tanT[n] * ipt[n] * pxcaMpysa[n];
955  errorProp(n, 0, 3) =
956  k[n] * pt[n] * pt[n] *
957  (cosP[n] * (alpha[n] * cosa[n] - sina[n]) + sinP[n] * 2.f * sinah[n] * (sinah[n] - alpha[n] * cosah[n]));
958  errorProp(n, 0, 4) = -2.f * k[n] * pt[n] * sinah[n] * (sinP[n] * cosah[n] + cosP[n] * sinah[n]);
959  errorProp(n, 0, 5) = deltaZ[n] * ipt[n] * pxcaMpysa[n] * icos2T[n];
960  }
961 
962  float pycaPpxsa[NN];
963 #pragma omp simd
964  for (int n = 0; n < NN; ++n) {
965  pycaPpxsa[n] = pyin[n] * cosa[n] + pxin[n] * sina[n];
966  }
967 
968 #pragma omp simd
969  for (int n = 0; n < NN; ++n) {
970  errorProp(n, 1, 2) = -tanT[n] * ipt[n] * pycaPpxsa[n];
971  errorProp(n, 1, 3) =
972  k[n] * pt[n] * pt[n] *
973  (sinP[n] * (alpha[n] * cosa[n] - sina[n]) - cosP[n] * 2.f * sinah[n] * (sinah[n] - alpha[n] * cosah[n]));
974  errorProp(n, 1, 4) = 2.f * k[n] * pt[n] * sinah[n] * (cosP[n] * cosah[n] - sinP[n] * sinah[n]);
975  errorProp(n, 1, 5) = deltaZ[n] * ipt[n] * pycaPpxsa[n] * icos2T[n];
976  }
977 
978 #pragma omp simd
979  for (int n = 0; n < NN; ++n) {
980  errorProp(n, 4, 2) = -ipt[n] * tanT[n] * kinv[n];
981  errorProp(n, 4, 3) = tanT[n] * deltaZ[n] * kinv[n];
982  errorProp(n, 4, 5) = ipt[n] * deltaZ[n] * kinv[n] * icos2T[n];
983  }
984 
985 #pragma omp simd
986  for (int n = 0; n < NN; ++n) {
987  dprint_np(
988  n,
989  "propagation end, dump parameters"
990  << std::endl
991  << "pos = " << outPar.At(n, 0, 0) << " " << outPar.At(n, 1, 0) << " " << outPar.At(n, 2, 0) << std::endl
992  << "mom (cart) = " << std::cos(outPar.At(n, 4, 0)) / outPar.At(n, 3, 0) << " "
993  << std::sin(outPar.At(n, 4, 0)) / outPar.At(n, 3, 0) << " "
994  << 1. / (outPar.At(n, 3, 0) * tan(outPar.At(n, 5, 0)))
995  << " r=" << std::sqrt(outPar.At(n, 0, 0) * outPar.At(n, 0, 0) + outPar.At(n, 1, 0) * outPar.At(n, 1, 0))
996  << " pT=" << 1. / std::abs(outPar.At(n, 3, 0)) << std::endl);
997  }
998 
999  // PROP-FAIL-ENABLE Disabled to keep physics changes minimal.
1000  // To be reviewed, enabled and processed accordingly elsewhere.
1001  /*
1002  // Check for errors, set fail-flag.
1003  for (int n = 0; n < NN; ++n) {
1004  // We propagate for alpha: mark fail when prop angle more than pi/2
1005  if (std::abs(alpha[n]) > 1.57) {
1006  dprintf("helixAtZ: more than quarter turn, alpha = %f\n", alpha[n]);
1007  outFailFlag[n] = 1;
1008  } else {
1009  // Have we reached desired z? We can't know, we copy desired z to actual z.
1010  // Are we close to apex? Same condition as in propToR, 12.5 deg, cos(78.5deg) = 0.2
1011  float dotp = (outPar.At(n, 0, 0) * std::cos(outPar.At(n, 4, 0)) +
1012  outPar.At(n, 1, 0) * std::sin(outPar.At(n, 4, 0))) /
1013  std::hypot(outPar.At(n, 0, 0), outPar.At(n, 1, 0));
1014  if (dotp < 0.2 || dotp < 0) {
1015  dprintf("helixAtZ: dot product bad, dotp = %f\n", dotp);
1016  outFailFlag[n] = 1;
1017  }
1018  }
1019  }
1020  */
1021 
1022 #ifdef DEBUG
1023  if (debug && g_debug) {
1024  for (int n = 0; n < N_proc; ++n) {
1025  dmutex_guard;
1026  std::cout << n << ": jacobian" << std::endl;
1027  printf("%5f %5f %5f %5f %5f %5f\n",
1028  errorProp(n, 0, 0),
1029  errorProp(n, 0, 1),
1030  errorProp(n, 0, 2),
1031  errorProp(n, 0, 3),
1032  errorProp(n, 0, 4),
1033  errorProp(n, 0, 5));
1034  printf("%5f %5f %5f %5f %5f %5f\n",
1035  errorProp(n, 1, 0),
1036  errorProp(n, 1, 1),
1037  errorProp(n, 1, 2),
1038  errorProp(n, 1, 3),
1039  errorProp(n, 1, 4),
1040  errorProp(n, 1, 5));
1041  printf("%5f %5f %5f %5f %5f %5f\n",
1042  errorProp(n, 2, 0),
1043  errorProp(n, 2, 1),
1044  errorProp(n, 2, 2),
1045  errorProp(n, 2, 3),
1046  errorProp(n, 2, 4),
1047  errorProp(n, 2, 5));
1048  printf("%5f %5f %5f %5f %5f %5f\n",
1049  errorProp(n, 3, 0),
1050  errorProp(n, 3, 1),
1051  errorProp(n, 3, 2),
1052  errorProp(n, 3, 3),
1053  errorProp(n, 3, 4),
1054  errorProp(n, 3, 5));
1055  printf("%5f %5f %5f %5f %5f %5f\n",
1056  errorProp(n, 4, 0),
1057  errorProp(n, 4, 1),
1058  errorProp(n, 4, 2),
1059  errorProp(n, 4, 3),
1060  errorProp(n, 4, 4),
1061  errorProp(n, 4, 5));
1062  printf("%5f %5f %5f %5f %5f %5f\n",
1063  errorProp(n, 5, 0),
1064  errorProp(n, 5, 1),
1065  errorProp(n, 5, 2),
1066  errorProp(n, 5, 3),
1067  errorProp(n, 5, 4),
1068  errorProp(n, 5, 5));
1069  }
1070  }
1071 #endif
1072  }
#define dprint_np(n, x)
Definition: Debug.h:96
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool g_debug
Definition: Debug.cc:2
T sqrt(T t)
Definition: SSEVec.h:23
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
constexpr float Bfield
Definition: Config.h:55
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
constexpr bool useTrigApprox
Definition: Config.h:50
#define debug
Definition: HDRShower.cc:19
constexpr float sol
Definition: Config.h:13
float hipo(float x, float y)
Definition: Matrix.h:9
float bFieldFromZR(const float z, const float r)
Definition: Config.h:126
void sincos4(const float x, float &sin, float &cos)
Definition: Matrix.h:13
Geom::Theta< T > theta() const

◆ hipo()

float mkfit::hipo ( float  x,
float  y 
)
inline

◆ hipo_sqr()

float mkfit::hipo_sqr ( float  x,
float  y 
)
inline

Definition at line 11 of file Matrix.h.

References x.

Referenced by mkfit::MkBase::radiusSqr().

11 { return x * x + y * y; }
float x

◆ hit2pos()

RVec mkfit::hit2pos ( const Hit h)

Definition at line 24 of file RntConversions.h.

References h.

Referenced by mkfit::MkFinder::selectHitIndicesV2().

24 { return {h.x(), h.y(), h.z()}; }
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ intersectThirdLayer()

void mkfit::intersectThirdLayer ( const float  a,
const float  b,
const float  hit1_x,
const float  hit1_y,
float &  lay2_x,
float &  lay2_y 
)
inline

Definition at line 9 of file seedtestMPlex.cc.

References a, testProducerWithPsetDescEmpty_cfi::a2, b, b2, f, getHypot(), mkfit::Config::maxCurvR, and mathSSE::sqrt().

Referenced by findSeedsByRoadSearch().

10  {
11  const float a2 = a * a;
12  const float b2 = b * b;
13  const float a2b2 = a2 + b2;
14  const float lay2rad2 = (Config::fRadialSpacing * Config::fRadialSpacing) * 9.0f; // average third radius squared
15  const float maxCurvR2 = Config::maxCurvR * Config::maxCurvR;
16 
17  const float quad =
18  std::sqrt(2.0f * maxCurvR2 * (a2b2 + lay2rad2) - (a2b2 - lay2rad2) * (a2b2 - lay2rad2) - maxCurvR2 * maxCurvR2);
19  const float pos[2] = {(a2 * a + a * (b2 + lay2rad2 - maxCurvR2) - b * quad) / a2b2,
20  (b2 * b + b * (a2 + lay2rad2 - maxCurvR2) + a * quad) / a2b2};
21  const float neg[2] = {(a2 * a + a * (b2 + lay2rad2 - maxCurvR2) + b * quad) / a2b2,
22  (b2 * b + b * (a2 + lay2rad2 - maxCurvR2) - a * quad) / a2b2};
23 
24  // since we have two intersection points, arbitrate which one is closer to layer2 hit
25  if (getHypot(pos[0] - hit1_x, pos[1] - hit1_y) < getHypot(neg[0] - hit1_x, neg[1] - hit1_y)) {
26  lay2_x = pos[0];
27  lay2_y = pos[1];
28  } else {
29  lay2_x = neg[0];
30  lay2_y = neg[1];
31  }
32  }
T sqrt(T t)
Definition: SSEVec.h:23
double f[11][100]
float getHypot(float x, float y)
Definition: Hit.h:47
bias2_t b2[25]
Definition: b2.h:9
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
constexpr float maxCurvR

◆ isFinite()

constexpr bool mkfit::isFinite ( float  x)

Definition at line 13 of file cms_common_macros.h.

References ztail::d, edm::isFinite(), MainPageGenerator::l, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, findQualityFiles::v, and x.

Referenced by mkfit::MkFinder::bkFitOutputTracks(), mkfit::TrackBase::hasNanNSillyValues(), mkfit::TrackBase::hasSillyValues(), and mkfit::MkFinder::selectHitIndices().

13  {
14 #ifdef MKFIT_STANDALONE
15  const unsigned int mask = 0x7f800000;
16  union {
17  unsigned int l;
18  float d;
19  } v = {.d = x};
20  return (v.l & mask) != mask;
21 #else
22  return edm::isFinite(x);
23 #endif
24  }
constexpr bool isFinite(T x)
d
Definition: ztail.py:151
float x

◆ isStripQCompatible()

bool mkfit::isStripQCompatible ( int  itrack,
bool  isBarrel,
const MPlexLS pErr,
const MPlexLV pPar,
const MPlexHS msErr,
const MPlexHV msPar 
)

Definition at line 1273 of file MkFinder.cc.

References funct::abs(), dprint, f, PixelPluginsPhase0_cfi::isBarrel, SiStripPI::max, amptDefault_cfi::proj, and mathSSE::sqrt().

Referenced by mkfit::MkFinder::findCandidates(), and mkfit::MkFinder::findCandidatesCloneEngine().

1274  {
1275  //check module compatibility via long strip side = L/sqrt(12)
1276  if (isBarrel) { //check z direction only
1277  const float res = std::abs(msPar.constAt(itrack, 2, 0) - pPar.constAt(itrack, 2, 0));
1278  const float hitHL = sqrt(msErr.constAt(itrack, 2, 2) * 3.f); //half-length
1279  const float qErr = sqrt(pErr.constAt(itrack, 2, 2));
1280  dprint("qCompat " << hitHL << " + " << 3.f * qErr << " vs " << res);
1281  return hitHL + std::max(3.f * qErr, 0.5f) > res;
1282  } else { //project on xy, assuming the strip Length >> Width
1283  const float res[2]{msPar.constAt(itrack, 0, 0) - pPar.constAt(itrack, 0, 0),
1284  msPar.constAt(itrack, 1, 0) - pPar.constAt(itrack, 1, 0)};
1285  const float hitT2 = msErr.constAt(itrack, 0, 0) + msErr.constAt(itrack, 1, 1);
1286  const float hitT2inv = 1.f / hitT2;
1287  const float proj[3] = {msErr.constAt(itrack, 0, 0) * hitT2inv,
1288  msErr.constAt(itrack, 0, 1) * hitT2inv,
1289  msErr.constAt(itrack, 1, 1) * hitT2inv};
1290  const float qErr =
1291  sqrt(std::abs(pErr.constAt(itrack, 0, 0) * proj[0] + 2.f * pErr.constAt(itrack, 0, 1) * proj[1] +
1292  pErr.constAt(itrack, 1, 1) * proj[2])); //take abs to avoid non-pos-def cases
1293  const float resProj =
1294  sqrt(res[0] * proj[0] * res[0] + 2.f * res[1] * proj[1] * res[0] + res[1] * proj[2] * res[1]);
1295  dprint("qCompat " << sqrt(hitT2 * 3.f) << " + " << 3.f * qErr << " vs " << resProj);
1296  return sqrt(hitT2 * 3.f) + std::max(3.f * qErr, 0.5f) > resProj;
1297  }
1298  }
Definition: Electron.h:6
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
#define dprint(x)
Definition: Debug.h:95

◆ kalmanComputeChi2()

void mkfit::kalmanComputeChi2 ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexQI inChg,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexQF outChi2,
const int  N_proc 
)

Definition at line 753 of file KalmanUtilsMPlex.cc.

References kalmanOperation(), and KFO_Calculate_Chi2.

759  {
760  kalmanOperation(KFO_Calculate_Chi2, psErr, psPar, msErr, msPar, dummy_err, dummy_par, outChi2, N_proc);
761  }
void kalmanOperation(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)

◆ kalmanComputeChi2Endcap()

void mkfit::kalmanComputeChi2Endcap ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexQI inChg,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexQF outChi2,
const int  N_proc 
)

Definition at line 1380 of file KalmanUtilsMPlex.cc.

References kalmanOperationEndcap(), and KFO_Calculate_Chi2.

1386  {
1387  kalmanOperationEndcap(KFO_Calculate_Chi2, psErr, psPar, msErr, msPar, dummy_err, dummy_par, outChi2, N_proc);
1388  }
void kalmanOperationEndcap(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)

◆ kalmanComputeChi2Plane()

void mkfit::kalmanComputeChi2Plane ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexQI inChg,
const MPlexHS msErr,
const MPlexHV msPar,
const MPlexHV plNrm,
const MPlexHV plDir,
MPlexQF outChi2,
const int  N_proc 
)

Definition at line 1075 of file KalmanUtilsMPlex.cc.

References kalmanOperationPlane(), and KFO_Calculate_Chi2.

1083  {
1085  KFO_Calculate_Chi2, psErr, psPar, msErr, msPar, plNrm, plDir, dummy_err, dummy_par, outChi2, N_proc);
1086  }
void kalmanOperationPlane(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)

◆ kalmanOperation()

void mkfit::kalmanOperation ( const int  kfOp,
const MPlexLS psErr,
const MPlexLV psPar,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexLS outErr,
MPlexLV outPar,
MPlexQF outChi2,
const int  N_proc 
)

Definition at line 797 of file KalmanUtilsMPlex.cc.

References Matriplex::hypot(), mps_fire::i, Matriplex::invertCramerSym(), dqmiolumiharvest::j, KFO_Calculate_Chi2, KFO_Local_Cov, KFO_Update_Params, dqmiodumpmetadata::n, NN, and squashPhiMPlex().

Referenced by mkfit::MkFinder::bkFitFitTracks(), mkfit::MkFinder::bkFitFitTracksBH(), kalmanComputeChi2(), kalmanPropagateAndComputeChi2(), kalmanPropagateAndUpdate(), and kalmanUpdate().

805  {
806 #ifdef DEBUG
807  {
808  dmutex_guard;
809  printf("psPar:\n");
810  for (int i = 0; i < 6; ++i) {
811  printf("%8f ", psPar.constAt(0, 0, i));
812  printf("\n");
813  }
814  printf("\n");
815  printf("psErr:\n");
816  for (int i = 0; i < 6; ++i) {
817  for (int j = 0; j < 6; ++j)
818  printf("%8f ", psErr.constAt(0, i, j));
819  printf("\n");
820  }
821  printf("\n");
822  printf("msPar:\n");
823  for (int i = 0; i < 3; ++i) {
824  printf("%8f ", msPar.constAt(0, 0, i));
825  printf("\n");
826  }
827  printf("\n");
828  printf("msErr:\n");
829  for (int i = 0; i < 3; ++i) {
830  for (int j = 0; j < 3; ++j)
831  printf("%8f ", msErr.constAt(0, i, j));
832  printf("\n");
833  }
834  printf("\n");
835  }
836 #endif
837 
838  // Rotate global point on tangent plane to cylinder
839  // Tangent point is half way between hit and propagate position
840 
841  // Rotation matrix
842  // rotT00 0 rotT01
843  // rotT01 0 -rotT00
844  // 0 1 0
845  // Minimize temporaries: only two float are needed!
846 
847  MPlexQF rotT00;
848  MPlexQF rotT01;
849  for (int n = 0; n < NN; ++n) {
850  if (n < N_proc) {
851  const float r = std::hypot(msPar.constAt(n, 0, 0), msPar.constAt(n, 1, 0));
852  rotT00.At(n, 0, 0) = -(msPar.constAt(n, 1, 0) + psPar.constAt(n, 1, 0)) / (2 * r);
853  rotT01.At(n, 0, 0) = (msPar.constAt(n, 0, 0) + psPar.constAt(n, 0, 0)) / (2 * r);
854  } else {
855  rotT00.At(n, 0, 0) = 0.0f;
856  rotT01.At(n, 0, 0) = 0.0f;
857  }
858  }
859 
860  MPlexHV res_glo; //position residual in global coordinates
861  SubtractFirst3(msPar, psPar, res_glo);
862 
863  MPlexHS resErr_glo; //covariance sum in global position coordinates
864  AddIntoUpperLeft3x3(psErr, msErr, resErr_glo);
865 
866  MPlex2V res_loc; //position residual in local coordinates
867  RotateResidualsOnTangentPlane(rotT00, rotT01, res_glo, res_loc);
868  MPlex2S resErr_loc; //covariance sum in local position coordinates
869  MPlexHH tempHH;
870  ProjectResErr(rotT00, rotT01, resErr_glo, tempHH);
871  ProjectResErrTransp(rotT00, rotT01, tempHH, resErr_loc);
872 
873 #ifdef DEBUG
874  {
875  dmutex_guard;
876  printf("res_glo:\n");
877  for (int i = 0; i < 3; ++i) {
878  printf("%8f ", res_glo.At(0, i, 0));
879  }
880  printf("\n");
881  printf("resErr_glo:\n");
882  for (int i = 0; i < 3; ++i) {
883  for (int j = 0; j < 3; ++j)
884  printf("%8f ", resErr_glo.At(0, i, j));
885  printf("\n");
886  }
887  printf("\n");
888  printf("res_loc:\n");
889  for (int i = 0; i < 2; ++i) {
890  printf("%8f ", res_loc.At(0, i, 0));
891  }
892  printf("\n");
893  printf("tempHH:\n");
894  for (int i = 0; i < 3; ++i) {
895  for (int j = 0; j < 3; ++j)
896  printf("%8f ", tempHH.At(0, i, j));
897  printf("\n");
898  }
899  printf("\n");
900  printf("resErr_loc:\n");
901  for (int i = 0; i < 2; ++i) {
902  for (int j = 0; j < 2; ++j)
903  printf("%8f ", resErr_loc.At(0, i, j));
904  printf("\n");
905  }
906  printf("\n");
907  }
908 #endif
909 
910  //invert the 2x2 matrix
911  Matriplex::invertCramerSym(resErr_loc);
912 
913  if (kfOp & KFO_Calculate_Chi2) {
914  Chi2Similarity(res_loc, resErr_loc, outChi2);
915 
916 #ifdef DEBUG
917  {
918  dmutex_guard;
919  printf("resErr_loc (Inv):\n");
920  for (int i = 0; i < 2; ++i) {
921  for (int j = 0; j < 2; ++j)
922  printf("%8f ", resErr_loc.At(0, i, j));
923  printf("\n");
924  }
925  printf("\n");
926  printf("chi2: %8f\n", outChi2.At(0, 0, 0));
927  }
928 #endif
929  }
930 
931  if (kfOp & KFO_Update_Params) {
932  MPlexLS psErrLoc = psErr;
933  if (kfOp & KFO_Local_Cov)
934  CovXYconstrain(rotT00, rotT01, psErr, psErrLoc);
935 
936  MPlexLH K; // kalman gain, fixme should be L2
937  KalmanHTG(rotT00, rotT01, resErr_loc, tempHH); // intermediate term to get kalman gain (H^T*G)
938  KalmanGain(psErrLoc, tempHH, K);
939 
940  MultResidualsAdd(K, psPar, res_loc, outPar);
941 
942  squashPhiMPlex(outPar, N_proc); // ensure phi is between |pi|
943 
944  MPlexLL tempLL;
945  KHMult(K, rotT00, rotT01, tempLL);
946  KHC(tempLL, psErrLoc, outErr);
947  outErr.subtract(psErrLoc, outErr);
948 
949 #ifdef DEBUG
950  {
951  dmutex_guard;
952  if (kfOp & KFO_Local_Cov) {
953  printf("psErrLoc:\n");
954  for (int i = 0; i < 6; ++i) {
955  for (int j = 0; j < 6; ++j)
956  printf("% 8e ", psErrLoc.At(0, i, j));
957  printf("\n");
958  }
959  printf("\n");
960  }
961  printf("resErr_loc (Inv):\n");
962  for (int i = 0; i < 2; ++i) {
963  for (int j = 0; j < 2; ++j)
964  printf("%8f ", resErr_loc.At(0, i, j));
965  printf("\n");
966  }
967  printf("\n");
968  printf("tempHH:\n");
969  for (int i = 0; i < 3; ++i) {
970  for (int j = 0; j < 3; ++j)
971  printf("%8f ", tempHH.At(0, i, j));
972  printf("\n");
973  }
974  printf("\n");
975  printf("K:\n");
976  for (int i = 0; i < 6; ++i) {
977  for (int j = 0; j < 3; ++j)
978  printf("%8f ", K.At(0, i, j));
979  printf("\n");
980  }
981  printf("\n");
982  printf("tempLL:\n");
983  for (int i = 0; i < 6; ++i) {
984  for (int j = 0; j < 6; ++j)
985  printf("%8f ", tempLL.At(0, i, j));
986  printf("\n");
987  }
988  printf("\n");
989  printf("outPar:\n");
990  for (int i = 0; i < 6; ++i) {
991  printf("%8f ", outPar.At(0, i, 0));
992  }
993  printf("\n");
994  printf("outErr:\n");
995  for (int i = 0; i < 6; ++i) {
996  for (int j = 0; j < 6; ++j)
997  printf("%8f ", outErr.At(0, i, j));
998  printf("\n");
999  }
1000  printf("\n");
1001  }
1002 #endif
1003  }
1004  }
Matriplex::Matriplex< float, HH, HH, NN > MPlexHH
Definition: Matrix.h:52
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
Definition: Matrix.h:48
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
Definition: Matrix.h:53
void squashPhiMPlex(MPlexLV &par, const int N_proc)
void invertCramerSym(MPlexSym< T, D, N > &A, double *determ=nullptr)
Definition: MatriplexSym.h:420
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
Matriplex::MatriplexSym< float, 2, NN > MPlex2S
Definition: Matrix.h:62
Matriplex::MatriplexSym< float, HH, NN > MPlexHS
Definition: Matrix.h:54
Matriplex::Matriplex< float, LL, HH, NN > MPlexLH
Definition: Matrix.h:64
Matriplex::Matriplex< float, 2, 1, NN > MPlex2V
Definition: Matrix.h:61
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanOperationEndcap()

void mkfit::kalmanOperationEndcap ( const int  kfOp,
const MPlexLS psErr,
const MPlexLV psPar,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexLS outErr,
MPlexLV outPar,
MPlexQF outChi2,
const int  N_proc 
)

Definition at line 1420 of file KalmanUtilsMPlex.cc.

References mps_fire::i, Matriplex::invertCramerSym(), dqmiolumiharvest::j, KFO_Calculate_Chi2, KFO_Update_Params, and squashPhiMPlex().

Referenced by mkfit::MkFinder::bkFitFitTracks(), mkfit::MkFinder::bkFitFitTracksBH(), kalmanComputeChi2Endcap(), kalmanPropagateAndComputeChi2Endcap(), kalmanPropagateAndUpdateEndcap(), and kalmanUpdateEndcap().

1428  {
1429 #ifdef DEBUG
1430  {
1431  dmutex_guard;
1432  printf("updateParametersEndcapMPlex\n");
1433  printf("psPar:\n");
1434  for (int i = 0; i < 6; ++i) {
1435  printf("%8f ", psPar.constAt(0, 0, i));
1436  printf("\n");
1437  }
1438  printf("\n");
1439  printf("msPar:\n");
1440  for (int i = 0; i < 3; ++i) {
1441  printf("%8f ", msPar.constAt(0, 0, i));
1442  printf("\n");
1443  }
1444  printf("\n");
1445  printf("psErr:\n");
1446  for (int i = 0; i < 6; ++i) {
1447  for (int j = 0; j < 6; ++j)
1448  printf("%8f ", psErr.constAt(0, i, j));
1449  printf("\n");
1450  }
1451  printf("\n");
1452  printf("msErr:\n");
1453  for (int i = 0; i < 3; ++i) {
1454  for (int j = 0; j < 3; ++j)
1455  printf("%8f ", msErr.constAt(0, i, j));
1456  printf("\n");
1457  }
1458  printf("\n");
1459  }
1460 #endif
1461 
1462  MPlex2V res;
1463  SubtractFirst2(msPar, psPar, res);
1464 
1465  MPlex2S resErr;
1466  AddIntoUpperLeft2x2(psErr, msErr, resErr);
1467 
1468 #ifdef DEBUG
1469  {
1470  dmutex_guard;
1471  printf("resErr:\n");
1472  for (int i = 0; i < 2; ++i) {
1473  for (int j = 0; j < 2; ++j)
1474  printf("%8f ", resErr.At(0, i, j));
1475  printf("\n");
1476  }
1477  printf("\n");
1478  }
1479 #endif
1480 
1481  //invert the 2x2 matrix
1483 
1484  if (kfOp & KFO_Calculate_Chi2) {
1485  Chi2Similarity(res, resErr, outChi2);
1486 
1487 #ifdef DEBUG
1488  {
1489  dmutex_guard;
1490  printf("resErr_loc (Inv):\n");
1491  for (int i = 0; i < 2; ++i) {
1492  for (int j = 0; j < 2; ++j)
1493  printf("%8f ", resErr.At(0, i, j));
1494  printf("\n");
1495  }
1496  printf("\n");
1497  printf("chi2: %8f\n", outChi2.At(0, 0, 0));
1498  }
1499 #endif
1500  }
1501 
1502  if (kfOp & KFO_Update_Params) {
1503  MPlexL2 K;
1504  KalmanGain(psErr, resErr, K);
1505 
1506  MultResidualsAdd(K, psPar, res, outPar);
1507 
1508  squashPhiMPlex(outPar, N_proc); // ensure phi is between |pi|
1509 
1510  KHC(K, psErr, outErr);
1511 
1512 #ifdef DEBUG
1513  {
1514  dmutex_guard;
1515  printf("outErr before subtract:\n");
1516  for (int i = 0; i < 6; ++i) {
1517  for (int j = 0; j < 6; ++j)
1518  printf("%8f ", outErr.At(0, i, j));
1519  printf("\n");
1520  }
1521  printf("\n");
1522  }
1523 #endif
1524 
1525  outErr.subtract(psErr, outErr);
1526 
1527 #ifdef DEBUG
1528  {
1529  dmutex_guard;
1530  printf("res:\n");
1531  for (int i = 0; i < 2; ++i) {
1532  printf("%8f ", res.At(0, i, 0));
1533  }
1534  printf("\n");
1535  printf("resErr (Inv):\n");
1536  for (int i = 0; i < 2; ++i) {
1537  for (int j = 0; j < 2; ++j)
1538  printf("%8f ", resErr.At(0, i, j));
1539  printf("\n");
1540  }
1541  printf("\n");
1542  printf("K:\n");
1543  for (int i = 0; i < 6; ++i) {
1544  for (int j = 0; j < 2; ++j)
1545  printf("%8f ", K.At(0, i, j));
1546  printf("\n");
1547  }
1548  printf("\n");
1549  printf("outPar:\n");
1550  for (int i = 0; i < 6; ++i) {
1551  printf("%8f ", outPar.At(0, i, 0));
1552  }
1553  printf("\n");
1554  printf("outErr:\n");
1555  for (int i = 0; i < 6; ++i) {
1556  for (int j = 0; j < 6; ++j)
1557  printf("%8f ", outErr.At(0, i, j));
1558  printf("\n");
1559  }
1560  printf("\n");
1561  }
1562 #endif
1563  }
1564  }
Matriplex::Matriplex< float, LL, 2, NN > MPlexL2
Definition: Matrix.h:67
Definition: Electron.h:6
void squashPhiMPlex(MPlexLV &par, const int N_proc)
void invertCramerSym(MPlexSym< T, D, N > &A, double *determ=nullptr)
Definition: MatriplexSym.h:420
Matriplex::MatriplexSym< float, 2, NN > MPlex2S
Definition: Matrix.h:62
Matriplex::Matriplex< float, 2, 1, NN > MPlex2V
Definition: Matrix.h:61

◆ kalmanOperationPlane()

void mkfit::kalmanOperationPlane ( const int  kfOp,
const MPlexLS psErr,
const MPlexLV psPar,
const MPlexHS msErr,
const MPlexHV msPar,
const MPlexHV plNrm,
const MPlexHV plDir,
MPlexLS outErr,
MPlexLV outPar,
MPlexQF outChi2,
const int  N_proc 
)

Definition at line 1116 of file KalmanUtilsMPlex.cc.

References mps_fire::i, Matriplex::invertCramerSym(), dqmiolumiharvest::j, KFO_Calculate_Chi2, KFO_Local_Cov, KFO_Update_Params, dqmiodumpmetadata::n, NN, and squashPhiMPlex().

Referenced by kalmanComputeChi2Plane(), kalmanPropagateAndComputeChi2Plane(), kalmanPropagateAndUpdatePlane(), and kalmanUpdatePlane().

1126  {
1127 #ifdef DEBUG
1128  {
1129  dmutex_guard;
1130  printf("psPar:\n");
1131  for (int i = 0; i < 6; ++i) {
1132  printf("%8f ", psPar.constAt(0, 0, i));
1133  printf("\n");
1134  }
1135  printf("\n");
1136  printf("psErr:\n");
1137  for (int i = 0; i < 6; ++i) {
1138  for (int j = 0; j < 6; ++j)
1139  printf("%8f ", psErr.constAt(0, i, j));
1140  printf("\n");
1141  }
1142  printf("\n");
1143  printf("msPar:\n");
1144  for (int i = 0; i < 3; ++i) {
1145  printf("%8f ", msPar.constAt(0, 0, i));
1146  printf("\n");
1147  }
1148  printf("\n");
1149  printf("msErr:\n");
1150  for (int i = 0; i < 3; ++i) {
1151  for (int j = 0; j < 3; ++j)
1152  printf("%8f ", msErr.constAt(0, i, j));
1153  printf("\n");
1154  }
1155  printf("\n");
1156  }
1157 #endif
1158 
1159  // Rotate global point on tangent plane to cylinder
1160  // Tangent point is half way between hit and propagate position
1161 
1162  // Rotation matrix
1163  // D0 D1 D2
1164  // X0 X1 X2
1165  // N0 N1 N2
1166  // where D is the strip direction vector plDir, N is the normal plNrm, and X is the cross product between the two
1167 
1168  MPlex2H prj;
1169  for (int n = 0; n < NN; ++n) {
1170  prj(n, 0, 0) = plDir(n, 0, 0);
1171  prj(n, 0, 1) = plDir(n, 1, 0);
1172  prj(n, 0, 2) = plDir(n, 2, 0);
1173  prj(n, 1, 0) = plNrm(n, 1, 0) * plDir(n, 2, 0) - plNrm(n, 2, 0) * plDir(n, 1, 0);
1174  prj(n, 1, 1) = plNrm(n, 2, 0) * plDir(n, 0, 0) - plNrm(n, 0, 0) * plDir(n, 2, 0);
1175  prj(n, 1, 2) = plNrm(n, 0, 0) * plDir(n, 1, 0) - plNrm(n, 1, 0) * plDir(n, 0, 0);
1176  }
1177 
1178  MPlexHV res_glo; //position residual in global coordinates
1179  SubtractFirst3(msPar, psPar, res_glo);
1180 
1181  MPlexHS resErr_glo; //covariance sum in global position coordinates
1182  AddIntoUpperLeft3x3(psErr, msErr, resErr_glo);
1183 
1184  MPlex2V res_loc; //position residual in local coordinates
1185  RotateResidualsOnPlane(prj, res_glo, res_loc);
1186  MPlex2S resErr_loc; //covariance sum in local position coordinates
1187  MPlex2H temp2H;
1188  ProjectResErr(prj, resErr_glo, temp2H);
1189  ProjectResErrTransp(prj, temp2H, resErr_loc);
1190 
1191 #ifdef DEBUG
1192  {
1193  dmutex_guard;
1194  printf("prj:\n");
1195  for (int i = 0; i < 2; ++i) {
1196  for (int j = 0; j < 3; ++j)
1197  printf("%8f ", prj.At(0, i, j));
1198  printf("\n");
1199  }
1200  printf("\n");
1201  printf("res_glo:\n");
1202  for (int i = 0; i < 3; ++i) {
1203  printf("%8f ", res_glo.At(0, i, 0));
1204  }
1205  printf("\n");
1206  printf("resErr_glo:\n");
1207  for (int i = 0; i < 3; ++i) {
1208  for (int j = 0; j < 3; ++j)
1209  printf("%8f ", resErr_glo.At(0, i, j));
1210  printf("\n");
1211  }
1212  printf("\n");
1213  printf("res_loc:\n");
1214  for (int i = 0; i < 2; ++i) {
1215  printf("%8f ", res_loc.At(0, i, 0));
1216  }
1217  printf("\n");
1218  printf("temp2H:\n");
1219  for (int i = 0; i < 2; ++i) {
1220  for (int j = 0; j < 3; ++j)
1221  printf("%8f ", temp2H.At(0, i, j));
1222  printf("\n");
1223  }
1224  printf("\n");
1225  printf("resErr_loc:\n");
1226  for (int i = 0; i < 2; ++i) {
1227  for (int j = 0; j < 2; ++j)
1228  printf("%8f ", resErr_loc.At(0, i, j));
1229  printf("\n");
1230  }
1231  printf("\n");
1232  }
1233 #endif
1234 
1235  //invert the 2x2 matrix
1236  Matriplex::invertCramerSym(resErr_loc);
1237 
1238  if (kfOp & KFO_Calculate_Chi2) {
1239  Chi2Similarity(res_loc, resErr_loc, outChi2);
1240 
1241 #ifdef DEBUG
1242  {
1243  dmutex_guard;
1244  printf("resErr_loc (Inv):\n");
1245  for (int i = 0; i < 2; ++i) {
1246  for (int j = 0; j < 2; ++j)
1247  printf("%8f ", resErr_loc.At(0, i, j));
1248  printf("\n");
1249  }
1250  printf("\n");
1251  printf("chi2: %8f\n", outChi2.At(0, 0, 0));
1252  }
1253 #endif
1254  }
1255 
1256  if (kfOp & KFO_Update_Params) {
1257  MPlexLS psErrLoc = psErr;
1258 
1259  MPlexH2 tempH2;
1260  MPlexL2 K; // kalman gain, fixme should be L2
1261  KalmanHTG(prj, resErr_loc, tempH2); // intermediate term to get kalman gain (H^T*G)
1262  KalmanGain(psErrLoc, tempH2, K);
1263 
1264  MultResidualsAdd(K, psPar, res_loc, outPar);
1265 
1266  squashPhiMPlex(outPar, N_proc); // ensure phi is between |pi|
1267 
1268  MPlexLL tempLL;
1269  KHMult(K, prj, tempLL);
1270  KHC(tempLL, psErrLoc, outErr);
1271  outErr.subtract(psErrLoc, outErr);
1272 
1273 #ifdef DEBUG
1274  {
1275  dmutex_guard;
1276  if (kfOp & KFO_Local_Cov) {
1277  printf("psErrLoc:\n");
1278  for (int i = 0; i < 6; ++i) {
1279  for (int j = 0; j < 6; ++j)
1280  printf("% 8e ", psErrLoc.At(0, i, j));
1281  printf("\n");
1282  }
1283  printf("\n");
1284  }
1285  printf("resErr_loc (Inv):\n");
1286  for (int i = 0; i < 2; ++i) {
1287  for (int j = 0; j < 2; ++j)
1288  printf("%8f ", resErr_loc.At(0, i, j));
1289  printf("\n");
1290  }
1291  printf("\n");
1292  printf("tempH2:\n");
1293  for (int i = 0; i < 3; ++i) {
1294  for (int j = 0; j < 2; ++j)
1295  printf("%8f ", tempH2.At(0, i, j));
1296  printf("\n");
1297  }
1298  printf("\n");
1299  printf("K:\n");
1300  for (int i = 0; i < 6; ++i) {
1301  for (int j = 0; j < 2; ++j)
1302  printf("%8f ", K.At(0, i, j));
1303  printf("\n");
1304  }
1305  printf("\n");
1306  printf("tempLL:\n");
1307  for (int i = 0; i < 6; ++i) {
1308  for (int j = 0; j < 6; ++j)
1309  printf("%8f ", tempLL.At(0, i, j));
1310  printf("\n");
1311  }
1312  printf("\n");
1313  printf("outPar:\n");
1314  for (int i = 0; i < 6; ++i) {
1315  printf("%8f ", outPar.At(0, i, 0));
1316  }
1317  printf("\n");
1318  printf("outErr:\n");
1319  for (int i = 0; i < 6; ++i) {
1320  for (int j = 0; j < 6; ++j)
1321  printf("%8f ", outErr.At(0, i, j));
1322  printf("\n");
1323  }
1324  printf("\n");
1325  }
1326 #endif
1327  }
1328  }
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
Definition: Matrix.h:48
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
Definition: Matrix.h:53
Matriplex::Matriplex< float, LL, 2, NN > MPlexL2
Definition: Matrix.h:67
void squashPhiMPlex(MPlexLV &par, const int N_proc)
void invertCramerSym(MPlexSym< T, D, N > &A, double *determ=nullptr)
Definition: MatriplexSym.h:420
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Matriplex::Matriplex< float, HH, 2, NN > MPlexH2
Definition: Matrix.h:68
Matriplex::Matriplex< float, 2, HH, NN > MPlex2H
Definition: Matrix.h:69
Matriplex::MatriplexSym< float, 2, NN > MPlex2S
Definition: Matrix.h:62
Matriplex::MatriplexSym< float, HH, NN > MPlexHS
Definition: Matrix.h:54
Matriplex::Matriplex< float, 2, 1, NN > MPlex2V
Definition: Matrix.h:61
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanPropagateAndComputeChi2()

void mkfit::kalmanPropagateAndComputeChi2 ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexQI inChg,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexQF outChi2,
MPlexLV propPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags propFlags,
const bool  propToHit 
)

Definition at line 763 of file KalmanUtilsMPlex.cc.

References Matriplex::hypot(), kalmanOperation(), KFO_Calculate_Chi2, dqmiodumpmetadata::n, NN, and propagateHelixToRMPlex().

773  {
774  propPar = psPar;
775  if (propToHit) {
776  MPlexLS propErr;
777  MPlexQF msRad;
778 #pragma omp simd
779  for (int n = 0; n < NN; ++n) {
780  if (n < N_proc) {
781  msRad.At(n, 0, 0) = std::hypot(msPar.constAt(n, 0, 0), msPar.constAt(n, 1, 0));
782  } else {
783  msRad.At(n, 0, 0) = 0.0f;
784  }
785  }
786 
787  propagateHelixToRMPlex(psErr, psPar, inChg, msRad, propErr, propPar, outFailFlag, N_proc, propFlags);
788 
789  kalmanOperation(KFO_Calculate_Chi2, propErr, propPar, msErr, msPar, dummy_err, dummy_par, outChi2, N_proc);
790  } else {
791  kalmanOperation(KFO_Calculate_Chi2, psErr, psPar, msErr, msPar, dummy_err, dummy_par, outChi2, N_proc);
792  }
793  }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
void propagateHelixToRMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
void kalmanOperation(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanPropagateAndComputeChi2Endcap()

void mkfit::kalmanPropagateAndComputeChi2Endcap ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexQI inChg,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexQF outChi2,
MPlexLV propPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags propFlags,
const bool  propToHit 
)

Definition at line 1390 of file KalmanUtilsMPlex.cc.

References kalmanOperationEndcap(), KFO_Calculate_Chi2, dqmiodumpmetadata::n, NN, and propagateHelixToZMPlex().

1400  {
1401  propPar = psPar;
1402  if (propToHit) {
1403  MPlexLS propErr;
1404  MPlexQF msZ;
1405 #pragma omp simd
1406  for (int n = 0; n < NN; ++n) {
1407  msZ.At(n, 0, 0) = msPar.constAt(n, 2, 0);
1408  }
1409 
1410  propagateHelixToZMPlex(psErr, psPar, inChg, msZ, propErr, propPar, outFailFlag, N_proc, propFlags);
1411 
1412  kalmanOperationEndcap(KFO_Calculate_Chi2, propErr, propPar, msErr, msPar, dummy_err, dummy_par, outChi2, N_proc);
1413  } else {
1414  kalmanOperationEndcap(KFO_Calculate_Chi2, psErr, psPar, msErr, msPar, dummy_err, dummy_par, outChi2, N_proc);
1415  }
1416  }
void kalmanOperationEndcap(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
void propagateHelixToZMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanPropagateAndComputeChi2Plane()

void mkfit::kalmanPropagateAndComputeChi2Plane ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexQI inChg,
const MPlexHS msErr,
const MPlexHV msPar,
const MPlexHV plNrm,
const MPlexHV plDir,
MPlexQF outChi2,
MPlexLV propPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags propFlags,
const bool  propToHit 
)

Definition at line 1088 of file KalmanUtilsMPlex.cc.

References kalmanOperationPlane(), KFO_Calculate_Chi2, and propagateHelixToPlaneMPlex().

Referenced by mkfit::MkFinder::findCandidates(), and mkfit::MkFinder::findCandidatesCloneEngine().

1100  {
1101  propPar = psPar;
1102  if (propToHit) {
1103  MPlexLS propErr;
1104  propagateHelixToPlaneMPlex(psErr, psPar, inChg, msPar, plNrm, propErr, propPar, outFailFlag, N_proc, propFlags);
1105 
1107  KFO_Calculate_Chi2, propErr, propPar, msErr, msPar, plNrm, plDir, dummy_err, dummy_par, outChi2, N_proc);
1108  } else {
1110  KFO_Calculate_Chi2, psErr, psPar, msErr, msPar, plNrm, plDir, dummy_err, dummy_par, outChi2, N_proc);
1111  }
1112  }
void propagateHelixToPlaneMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexHV &plPnt, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
void kalmanOperationPlane(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanPropagateAndUpdate()

void mkfit::kalmanPropagateAndUpdate ( const MPlexLS psErr,
const MPlexLV psPar,
MPlexQI Chg,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexLS outErr,
MPlexLV outPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags propFlags,
const bool  propToHit 
)

Definition at line 715 of file KalmanUtilsMPlex.cc.

References Matriplex::hypot(), kalmanOperation(), KFO_Local_Cov, KFO_Update_Params, dqmiodumpmetadata::n, NN, and propagateHelixToRMPlex().

725  {
726  if (propToHit) {
727  MPlexLS propErr;
728  MPlexLV propPar;
729  MPlexQF msRad;
730 #pragma omp simd
731  for (int n = 0; n < NN; ++n) {
732  msRad.At(n, 0, 0) = std::hypot(msPar.constAt(n, 0, 0), msPar.constAt(n, 1, 0));
733  }
734 
735  propagateHelixToRMPlex(psErr, psPar, Chg, msRad, propErr, propPar, outFailFlag, N_proc, propFlags);
736 
738  KFO_Update_Params | KFO_Local_Cov, propErr, propPar, msErr, msPar, outErr, outPar, dummy_chi2, N_proc);
739  } else {
741  KFO_Update_Params | KFO_Local_Cov, psErr, psPar, msErr, msPar, outErr, outPar, dummy_chi2, N_proc);
742  }
743  for (int n = 0; n < NN; ++n) {
744  if (n < N_proc && outPar.At(n, 3, 0) < 0) {
745  Chg.At(n, 0, 0) = -Chg.At(n, 0, 0);
746  outPar.At(n, 3, 0) = -outPar.At(n, 3, 0);
747  }
748  }
749  }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
void propagateHelixToRMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
Definition: Matrix.h:49
void kalmanOperation(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanPropagateAndUpdateEndcap()

void mkfit::kalmanPropagateAndUpdateEndcap ( const MPlexLS psErr,
const MPlexLV psPar,
MPlexQI Chg,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexLS outErr,
MPlexLV outPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags propFlags,
const bool  propToHit 
)

Definition at line 1344 of file KalmanUtilsMPlex.cc.

References kalmanOperationEndcap(), KFO_Update_Params, dqmiodumpmetadata::n, NN, and propagateHelixToZMPlex().

1354  {
1355  if (propToHit) {
1356  MPlexLS propErr;
1357  MPlexLV propPar;
1358  MPlexQF msZ;
1359 #pragma omp simd
1360  for (int n = 0; n < NN; ++n) {
1361  msZ.At(n, 0, 0) = msPar.constAt(n, 2, 0);
1362  }
1363 
1364  propagateHelixToZMPlex(psErr, psPar, Chg, msZ, propErr, propPar, outFailFlag, N_proc, propFlags);
1365 
1366  kalmanOperationEndcap(KFO_Update_Params, propErr, propPar, msErr, msPar, outErr, outPar, dummy_chi2, N_proc);
1367  } else {
1368  kalmanOperationEndcap(KFO_Update_Params, psErr, psPar, msErr, msPar, outErr, outPar, dummy_chi2, N_proc);
1369  }
1370  for (int n = 0; n < NN; ++n) {
1371  if (n < N_proc && outPar.At(n, 3, 0) < 0) {
1372  Chg.At(n, 0, 0) = -Chg.At(n, 0, 0);
1373  outPar.At(n, 3, 0) = -outPar.At(n, 3, 0);
1374  }
1375  }
1376  }
void kalmanOperationEndcap(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
Definition: Matrix.h:49
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
void propagateHelixToZMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanPropagateAndUpdatePlane()

void mkfit::kalmanPropagateAndUpdatePlane ( const MPlexLS psErr,
const MPlexLV psPar,
MPlexQI Chg,
const MPlexHS msErr,
const MPlexHV msPar,
const MPlexHV plNrm,
const MPlexHV plDir,
MPlexLS outErr,
MPlexLV outPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags propFlags,
const bool  propToHit 
)

Definition at line 1023 of file KalmanUtilsMPlex.cc.

References kalmanOperationPlane(), KFO_Local_Cov, KFO_Update_Params, dqmiodumpmetadata::n, NN, and propagateHelixToPlaneMPlex().

Referenced by mkfit::MkFinder::updateWithLoadedHit().

1035  {
1036  if (propToHit) {
1037  MPlexLS propErr;
1038  MPlexLV propPar;
1039  propagateHelixToPlaneMPlex(psErr, psPar, Chg, msPar, plNrm, propErr, propPar, outFailFlag, N_proc, propFlags);
1040 
1042  propErr,
1043  propPar,
1044  msErr,
1045  msPar,
1046  plNrm,
1047  plDir,
1048  outErr,
1049  outPar,
1050  dummy_chi2,
1051  N_proc);
1052  } else {
1054  psErr,
1055  psPar,
1056  msErr,
1057  msPar,
1058  plNrm,
1059  plDir,
1060  outErr,
1061  outPar,
1062  dummy_chi2,
1063  N_proc);
1064  }
1065  for (int n = 0; n < NN; ++n) {
1066  if (outPar.At(n, 3, 0) < 0) {
1067  Chg.At(n, 0, 0) = -Chg.At(n, 0, 0);
1068  outPar.At(n, 3, 0) = -outPar.At(n, 3, 0);
1069  }
1070  }
1071  }
void propagateHelixToPlaneMPlex(const MPlexLS &inErr, const MPlexLV &inPar, const MPlexQI &inChg, const MPlexHV &plPnt, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags, const MPlexQI *noMatEffPtr)
void kalmanOperationPlane(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
Definition: Matrix.h:49
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50

◆ kalmanUpdate()

void mkfit::kalmanUpdate ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexLS outErr,
MPlexLV outPar,
const int  N_proc 
)

Definition at line 705 of file KalmanUtilsMPlex.cc.

References kalmanOperation(), KFO_Local_Cov, and KFO_Update_Params.

Referenced by mkfit::MkFitter::fitTracksWithInterSlurp().

711  {
712  kalmanOperation(KFO_Update_Params | KFO_Local_Cov, psErr, psPar, msErr, msPar, outErr, outPar, dummy_chi2, N_proc);
713  }
void kalmanOperation(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)

◆ kalmanUpdateEndcap()

void mkfit::kalmanUpdateEndcap ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexLS outErr,
MPlexLV outPar,
const int  N_proc 
)

Definition at line 1334 of file KalmanUtilsMPlex.cc.

References kalmanOperationEndcap(), and KFO_Update_Params.

1340  {
1341  kalmanOperationEndcap(KFO_Update_Params, psErr, psPar, msErr, msPar, outErr, outPar, dummy_chi2, N_proc);
1342  }
void kalmanOperationEndcap(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)

◆ kalmanUpdatePlane()

void mkfit::kalmanUpdatePlane ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexHS msErr,
const MPlexHV msPar,
const MPlexHV plNrm,
const MPlexHV plDir,
MPlexLS outErr,
MPlexLV outPar,
const int  N_proc 
)

Definition at line 1010 of file KalmanUtilsMPlex.cc.

References kalmanOperationPlane(), KFO_Local_Cov, and KFO_Update_Params.

1018  {
1020  KFO_Update_Params | KFO_Local_Cov, psErr, psPar, msErr, msPar, plNrm, plDir, outErr, outPar, dummy_chi2, N_proc);
1021  }
void kalmanOperationPlane(const int kfOp, const MPlexLS &psErr, const MPlexLV &psPar, const MPlexHS &msErr, const MPlexHV &msPar, const MPlexHV &plNrm, const MPlexHV &plDir, MPlexLS &outErr, MPlexLV &outPar, MPlexQF &outChi2, const int N_proc)

◆ operator==()

template<class T , class U >
bool mkfit::operator== ( const CcAlloc< T > &  a,
const CcAlloc< U > &  b 
)

Definition at line 151 of file TrackStructures.h.

References a, and b.

151  {
152  return a.pool_id() == b.pool_id();
153  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

◆ passStripChargePCMfromTrack()

bool mkfit::passStripChargePCMfromTrack ( int  itrack,
bool  isBarrel,
unsigned int  pcm,
unsigned int  pcmMin,
const MPlexLV pPar,
const MPlexHS msErr 
)

Definition at line 1305 of file MkFinder.cc.

References funct::abs(), funct::cos(), dprint, f, PixelPluginsPhase0_cfi::isBarrel, mkfit::Hit::maxChargePerCM(), amptDefault_cfi::proj, funct::sin(), and mathSSE::sqrt().

Referenced by mkfit::MkFinder::findCandidates(), and mkfit::MkFinder::findCandidatesCloneEngine().

1306  {
1307  //skip the overflow case
1308  if (pcm >= Hit::maxChargePerCM())
1309  return true;
1310 
1311  float qSF;
1312  if (isBarrel) { //project in x,y, assuming zero-error direction is in this plane
1313  const float hitT2 = msErr.constAt(itrack, 0, 0) + msErr.constAt(itrack, 1, 1);
1314  const float hitT2inv = 1.f / hitT2;
1315  const float proj[3] = {msErr.constAt(itrack, 0, 0) * hitT2inv,
1316  msErr.constAt(itrack, 0, 1) * hitT2inv,
1317  msErr.constAt(itrack, 1, 1) * hitT2inv};
1318  const bool detXY_OK =
1319  std::abs(proj[0] * proj[2] - proj[1] * proj[1]) < 0.1f; //check that zero-direction is close
1320  const float cosP = cos(pPar.constAt(itrack, 4, 0));
1321  const float sinP = sin(pPar.constAt(itrack, 4, 0));
1322  const float sinT = std::abs(sin(pPar.constAt(itrack, 5, 0)));
1323  //qSF = sqrt[(px,py)*(1-proj)*(px,py)]/p = sinT*sqrt[(cosP,sinP)*(1-proj)*(cosP,sinP)].
1324  qSF = detXY_OK ? sinT * std::sqrt(std::abs(1.f + cosP * cosP * proj[0] + sinP * sinP * proj[2] -
1325  2.f * cosP * sinP * proj[1]))
1326  : 1.f;
1327  } else { //project on z
1328  // p_zLocal/p = p_z/p = cosT
1329  qSF = std::abs(cos(pPar.constAt(itrack, 5, 0)));
1330  }
1331 
1332  const float qCorr = pcm * qSF;
1333  dprint("pcm " << pcm << " * " << qSF << " = " << qCorr << " vs " << pcmMin);
1334  return qCorr > pcmMin;
1335  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
#define dprint(x)
Definition: Debug.h:95

◆ print() [1/5]

void mkfit::print ( std::string_view  label,
const MeasurementState s 
)

Definition at line 8 of file Hit.cc.

References gather_cfg::cout, dumpMatrix(), label, and alignCSCRings::s.

Referenced by mkfit::Shell::Compare(), conformalFitMPlex(), print(), and mkfit::StdSeq::track_print().

8  {
9  std::cout << label << std::endl;
10  std::cout << "x: " << s.parameters()[0] << " y: " << s.parameters()[1] << " z: " << s.parameters()[2] << std::endl
11  << "errors: " << std::endl;
12  dumpMatrix(s.errors());
13  std::cout << std::endl;
14  }
char const * label
void dumpMatrix(Matrix m)
Definition: MatrixSTypes.h:37

◆ print() [2/5]

void mkfit::print ( const TrackState s)

Definition at line 402 of file Track.cc.

References gather_cfg::cout, dumpMatrix(), and alignCSCRings::s.

402  {
403  std::cout << " x: " << s.parameters[0] << " y: " << s.parameters[1] << " z: " << s.parameters[2] << std::endl
404  << " px: " << s.parameters[3] << " py: " << s.parameters[4] << " pz: " << s.parameters[5] << std::endl
405  << "valid: " << s.valid << " errors: " << std::endl;
406  dumpMatrix(s.errors);
407  std::cout << std::endl;
408  }
void dumpMatrix(Matrix m)
Definition: MatrixSTypes.h:37

◆ print() [3/5]

void mkfit::print ( std::string  pfx,
int  itrack,
const Track trk,
bool  print_hits = false 
)

Definition at line 410 of file Track.cc.

References gather_cfg::cout, mkfit::Track::getHitIdx(), mkfit::Track::getHitLyr(), mps_fire::i, mkfit::TrackBase::label(), mkfit::Track::nFoundHits(), mkfit::Track::nTotalHits(), geometryDiffVisualizer::pfx, print(), and mkfit::TrackBase::state().

410  {
411  std::cout << std::endl
412  << pfx << ": " << itrack << " hits: " << trk.nFoundHits() << " label: " << trk.label() << " State"
413  << std::endl;
414  print(trk.state());
415  if (print_hits) {
416  for (int i = 0; i < trk.nTotalHits(); ++i)
417  printf(" %2d: lyr %2d idx %d\n", i, trk.getHitLyr(i), trk.getHitIdx(i));
418  }
419  }
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ print() [4/5]

void mkfit::print ( std::string  pfx,
const TrackState s 
)

Definition at line 421 of file Track.cc.

References gather_cfg::cout, geometryDiffVisualizer::pfx, print(), and alignCSCRings::s.

421  {
422  std::cout << pfx << std::endl;
423  print(s);
424  }
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ print() [5/5]

void mkfit::print ( std::string  pfx,
int  itrack,
const Track trk,
const Event ev 
)

Definition at line 1072 of file Event.cc.

References gather_cfg::cout, makeMEIFBenchmarkPlots::ev, mkfit::Track::getHitOnTrack(), h, mps_fire::i, mkfit::TrackBase::label(), mkfit::Track::nFoundHits(), mkfit::Track::nTotalHits(), geometryDiffVisualizer::pfx, print(), and mkfit::TrackBase::state().

1072  {
1073  std::cout << std::endl
1074  << pfx << ": " << itrack << " hits: " << trk.nFoundHits() << " label: " << trk.label()
1075  << " State:" << std::endl;
1076  print(trk.state());
1077 
1078  for (int i = 0; i < trk.nTotalHits(); ++i) {
1079  auto hot = trk.getHitOnTrack(i);
1080  printf(" %2d: lyr %2d idx %5d", i, hot.layer, hot.index);
1081  if (hot.index >= 0) {
1082  auto &h = ev.layerHits_[hot.layer][hot.index];
1083  int hl = ev.simHitsInfo_[h.mcHitID()].mcTrackID_;
1084  printf(" %4d %8.3f %8.3f %8.3f r=%.3f\n", hl, h.x(), h.y(), h.z(), h.r());
1085  } else {
1086  printf("\n");
1087  }
1088  }
1089  }
void print(std::string pfx, int itrack, const Track &trk, const Event &ev)
Definition: Event.cc:1072
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ propagateHelixToPlaneMPlex()

void mkfit::propagateHelixToPlaneMPlex ( const MPlexLS inErr,
const MPlexLV inPar,
const MPlexQI inChg,
const MPlexHV plPnt,
const MPlexHV plNrm,
MPlexLS outErr,
MPlexLV outPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags pflags,
const MPlexQI noMatEffPtr 
)

Definition at line 1090 of file PropagationMPlex.cc.

References funct::abs(), mkfit::PropagationFlags::apply_material, applyMaterialEffects(), funct::cos(), debug, dprint_np, dprintf, g_debug, helixAtPlane(), Matriplex::hypot(), mps_fire::i, dqmiolumiharvest::j, GetRecoTauVFromDQM_MC_cff::kk, mkfit::TrackerInfo::material_checked(), dqmiodumpmetadata::n, NN, mkfit::TrackerInfo::Material::radl, funct::sin(), mathSSE::sqrt(), squashPhiMPlex(), funct::tan(), groupFilesInBlocks::temp, and mkfit::PropagationFlags::tracker_info.

Referenced by kalmanPropagateAndComputeChi2Plane(), and kalmanPropagateAndUpdatePlane().

1100  {
1101  // debug = true;
1102 
1103  outErr = inErr;
1104  outPar = inPar;
1105 
1106  MPlexQF pathL;
1107  MPlexLL errorProp;
1108 
1109  helixAtPlane(inPar, inChg, plPnt, plNrm, pathL, outPar, errorProp, outFailFlag, N_proc, pflags);
1110 
1111  for (int n = 0; n < NN; ++n) {
1112  dprint_np(
1113  n,
1114  "propagation to plane end, dump parameters\n"
1115  //<< " D = " << s[n] << " alpha = " << s[n] * std::sin(inPar(n, 5, 0)) * inPar(n, 3, 0) * kinv[n] << " kinv = " << kinv[n] << std::endl
1116  << " pos = " << outPar(n, 0, 0) << " " << outPar(n, 1, 0) << " " << outPar(n, 2, 0) << "\t\t r="
1117  << std::sqrt(outPar(n, 0, 0) * outPar(n, 0, 0) + outPar(n, 1, 0) * outPar(n, 1, 0)) << std::endl
1118  << " mom = " << outPar(n, 3, 0) << " " << outPar(n, 4, 0) << " " << outPar(n, 5, 0) << std::endl
1119  << " cart= " << std::cos(outPar(n, 4, 0)) / outPar(n, 3, 0) << " "
1120  << std::sin(outPar(n, 4, 0)) / outPar(n, 3, 0) << " " << 1. / (outPar(n, 3, 0) * tan(outPar(n, 5, 0)))
1121  << "\t\tpT=" << 1. / std::abs(outPar(n, 3, 0)) << std::endl);
1122  }
1123 
1124 #ifdef DEBUG
1125  if (debug && g_debug) {
1126  for (int kk = 0; kk < N_proc; ++kk) {
1127  dprintf("inPar %d\n", kk);
1128  for (int i = 0; i < 6; ++i) {
1129  dprintf("%8f ", inPar.constAt(kk, i, 0));
1130  }
1131  dprintf("\n");
1132  dprintf("inErr %d\n", kk);
1133  for (int i = 0; i < 6; ++i) {
1134  for (int j = 0; j < 6; ++j)
1135  dprintf("%8f ", inErr.constAt(kk, i, j));
1136  dprintf("\n");
1137  }
1138  dprintf("\n");
1139 
1140  for (int kk = 0; kk < N_proc; ++kk) {
1141  dprintf("plNrm %d\n", kk);
1142  for (int j = 0; j < 3; ++j)
1143  dprintf("%8f ", plNrm.constAt(kk, 0, j));
1144  }
1145  dprintf("\n");
1146 
1147  for (int kk = 0; kk < N_proc; ++kk) {
1148  dprintf("pathL %d\n", kk);
1149  for (int j = 0; j < 1; ++j)
1150  dprintf("%8f ", pathL.constAt(kk, 0, j));
1151  }
1152  dprintf("\n");
1153 
1154  dprintf("errorProp %d\n", kk);
1155  for (int i = 0; i < 6; ++i) {
1156  for (int j = 0; j < 6; ++j)
1157  dprintf("%8f ", errorProp.At(kk, i, j));
1158  dprintf("\n");
1159  }
1160  dprintf("\n");
1161  }
1162  }
1163 #endif
1164 
1165  // Matriplex version of:
1166  // result.errors = ROOT::Math::Similarity(errorProp, outErr);
1167  MPlexLL temp;
1168  MultHelixPropFull(errorProp, outErr, temp);
1169  MultHelixPropTranspFull(errorProp, temp, outErr);
1170 
1171 #ifdef DEBUG
1172  if (debug && g_debug) {
1173  for (int kk = 0; kk < N_proc; ++kk) {
1174  dprintf("outErr %d\n", kk);
1175  for (int i = 0; i < 6; ++i) {
1176  for (int j = 0; j < 6; ++j)
1177  dprintf("%8f ", outErr.constAt(kk, i, j));
1178  dprintf("\n");
1179  }
1180  dprintf("\n");
1181  }
1182  }
1183 #endif
1184 
1185  if (pflags.apply_material) {
1186  MPlexQF hitsRl;
1187  MPlexQF hitsXi;
1188  MPlexQF propSign;
1189 
1190  const TrackerInfo& tinfo = *pflags.tracker_info;
1191 
1192 #pragma omp simd
1193  for (int n = 0; n < NN; ++n) {
1194  if (n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(n, 0, 0))) {
1195  hitsRl(n, 0, 0) = 0.f;
1196  hitsXi(n, 0, 0) = 0.f;
1197  } else {
1198  const float hypo = std::hypot(outPar(n, 0, 0), outPar(n, 1, 0));
1199  auto mat = tinfo.material_checked(std::abs(outPar(n, 2, 0)), hypo);
1200  hitsRl(n, 0, 0) = mat.radl;
1201  hitsXi(n, 0, 0) = mat.bbxi;
1202  }
1203  propSign(n, 0, 0) = (pathL(n, 0, 0) > 0.f ? 1.f : -1.f);
1204  }
1205  applyMaterialEffects(hitsRl, hitsXi, propSign, plNrm, outErr, outPar, N_proc);
1206 #ifdef DEBUG
1207  if (debug && g_debug) {
1208  for (int kk = 0; kk < N_proc; ++kk) {
1209  dprintf("propSign %d\n", kk);
1210  for (int i = 0; i < 1; ++i) {
1211  dprintf("%8f ", propSign.constAt(kk, i, 0));
1212  }
1213  dprintf("\n");
1214  dprintf("plNrm %d\n", kk);
1215  for (int i = 0; i < 3; ++i) {
1216  dprintf("%8f ", plNrm.constAt(kk, i, 0));
1217  }
1218  dprintf("\n");
1219  dprintf("outErr(after material) %d\n", kk);
1220  for (int i = 0; i < 6; ++i) {
1221  for (int j = 0; j < 6; ++j)
1222  dprintf("%8f ", outErr.constAt(kk, i, j));
1223  dprintf("\n");
1224  }
1225  dprintf("\n");
1226  }
1227  }
1228 #endif
1229  }
1230 
1231  squashPhiMPlex(outPar, N_proc); // ensure phi is between |pi|
1232 
1233  // PROP-FAIL-ENABLE To keep physics changes minimal, we always restore the
1234  // state to input when propagation fails -- as was the default before.
1235  // if (pflags.copy_input_state_on_fail) {
1236  for (int i = 0; i < N_proc; ++i) {
1237  if (outFailFlag(i, 0, 0)) {
1238  outPar.copySlot(i, inPar);
1239  outErr.copySlot(i, inErr);
1240  }
1241  }
1242  // }
1243  }
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
Definition: Matrix.h:48
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
#define dprint_np(n, x)
Definition: Debug.h:96
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const TrackerInfo * tracker_info
void applyMaterialEffects(const MPlexQF &hitsRl, const MPlexQF &hitsXi, const MPlexQF &propSign, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
void squashPhiMPlex(MPlexLV &par, const int N_proc)
bool g_debug
Definition: Debug.cc:2
T sqrt(T t)
Definition: SSEVec.h:23
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
void helixAtPlane(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexHV &plPnt, const MPlexHV &plNrm, MPlexQF &pathL, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
Material material_checked(float z, float r) const
Definition: TrackerInfo.h:240
#define dprintf(...)
Definition: Debug.h:98

◆ propagateHelixToRMPlex()

void mkfit::propagateHelixToRMPlex ( const MPlexLS inErr,
const MPlexLV inPar,
const MPlexQI inChg,
const MPlexQF msRad,
MPlexLS outErr,
MPlexLV outPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags pflags,
const MPlexQI noMatEffPtr 
)

Definition at line 498 of file PropagationMPlex.cc.

References funct::abs(), mkfit::PropagationFlags::apply_material, applyMaterialEffects(), funct::cos(), debug, dprintf, g_debug, helixAtRFromIterativeCCS(), hipo(), mps_fire::i, dqmiolumiharvest::j, GetRecoTauVFromDQM_MC_cff::kk, mkfit::TrackerInfo::material_checked(), dqmiodumpmetadata::n, NN, mkfit::TrackerInfo::Material::radl, funct::sin(), squashPhiMPlex(), groupFilesInBlocks::temp, and mkfit::PropagationFlags::tracker_info.

Referenced by kalmanPropagateAndComputeChi2(), kalmanPropagateAndUpdate(), mkfit::MkBase::propagateTracksToHitR(), and mkfit::MkBase::propagateTracksToR().

507  {
508  // bool debug = true;
509 
510  // This is used further down when calculating similarity with errorProp (and before in DEBUG).
511  // MT: I don't think this really needed if we use inErr where required.
512  outErr = inErr;
513  // This requirement for helixAtRFromIterativeCCS_impl() and for helixAtRFromIterativeCCSFullJac().
514  // MT: This should be properly handled in both functions (expecting input in output parameters sucks).
515  outPar = inPar;
516 
517  MPlexLL errorProp;
518 
519  helixAtRFromIterativeCCS(inPar, inChg, msRad, outPar, errorProp, outFailFlag, N_proc, pflags);
520 
521 #ifdef DEBUG
522  if (debug && g_debug) {
523  for (int kk = 0; kk < N_proc; ++kk) {
524  dprintf("outErr before prop %d\n", kk);
525  for (int i = 0; i < 6; ++i) {
526  for (int j = 0; j < 6; ++j)
527  dprintf("%8f ", outErr.At(kk, i, j));
528  dprintf("\n");
529  }
530  dprintf("\n");
531 
532  dprintf("errorProp %d\n", kk);
533  for (int i = 0; i < 6; ++i) {
534  for (int j = 0; j < 6; ++j)
535  dprintf("%8f ", errorProp.At(kk, i, j));
536  dprintf("\n");
537  }
538  dprintf("\n");
539  }
540  }
541 #endif
542 
543  // MultHelixProp can be optimized for CCS coordinates, see GenMPlexOps.pl
544  MPlexLL temp;
545  MultHelixProp(errorProp, outErr, temp);
546  MultHelixPropTransp(errorProp, temp, outErr);
547  // can replace with: MultHelixPropFull(errorProp, outErr, temp); MultHelixPropTranspFull(errorProp, temp, outErr);
548 
549  if (pflags.apply_material) {
550  MPlexQF hitsRl;
551  MPlexQF hitsXi;
552  MPlexQF propSign;
553 
554  const TrackerInfo& tinfo = *pflags.tracker_info;
555 
556 #pragma omp simd
557  for (int n = 0; n < NN; ++n) {
558  if (n < N_proc) {
559  if (outFailFlag(n, 0, 0) || (noMatEffPtr && noMatEffPtr->constAt(n, 0, 0))) {
560  hitsRl(n, 0, 0) = 0.f;
561  hitsXi(n, 0, 0) = 0.f;
562  } else {
563  auto mat = tinfo.material_checked(std::abs(outPar(n, 2, 0)), msRad(n, 0, 0));
564  hitsRl(n, 0, 0) = mat.radl;
565  hitsXi(n, 0, 0) = mat.bbxi;
566  }
567  const float r0 = hipo(inPar(n, 0, 0), inPar(n, 1, 0));
568  const float r = msRad(n, 0, 0);
569  propSign(n, 0, 0) = (r > r0 ? 1. : -1.);
570  }
571  }
572  MPlexHV plNrm;
573 #pragma omp simd
574  for (int n = 0; n < NN; ++n) {
575  plNrm(n, 0, 0) = std::cos(outPar.constAt(n, 4, 0));
576  plNrm(n, 1, 0) = std::sin(outPar.constAt(n, 4, 0));
577  plNrm(n, 2, 0) = 0.f;
578  }
579  applyMaterialEffects(hitsRl, hitsXi, propSign, plNrm, outErr, outPar, N_proc);
580  }
581 
582  squashPhiMPlex(outPar, N_proc); // ensure phi is between |pi|
583 
584  // Matriplex version of:
585  // result.errors = ROOT::Math::Similarity(errorProp, outErr);
586 
587  /*
588  // To be used with: MPT_DIM = 1
589  if (fabs(sqrt(outPar[0]*outPar[0]+outPar[1]*outPar[1]) - msRad[0]) > 0.0001)
590  {
591  std::cout << "DID NOT GET TO R, FailFlag=" << failFlag[0]
592  << " dR=" << msRad[0] - std::hypot(outPar[0],outPar[1])
593  << " r=" << msRad[0] << " rin=" << std::hypot(inPar[0],inPar[1]) << " rout=" << std::hypot(outPar[0],outPar[1])
594  << std::endl;
595  // std::cout << " pt=" << pt << " pz=" << inPar.At(n, 2) << std::endl;
596  }
597  */
598 
599  // PROP-FAIL-ENABLE To keep physics changes minimal, we always restore the
600  // state to input when propagation fails -- as was the default before.
601  // if (pflags.copy_input_state_on_fail) {
602  for (int i = 0; i < N_proc; ++i) {
603  if (outFailFlag(i, 0, 0)) {
604  outPar.copySlot(i, inPar);
605  outErr.copySlot(i, inErr);
606  }
607  }
608  // }
609  }
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
Definition: Matrix.h:48
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
Definition: Matrix.h:53
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const TrackerInfo * tracker_info
void applyMaterialEffects(const MPlexQF &hitsRl, const MPlexQF &hitsXi, const MPlexQF &propSign, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
void squashPhiMPlex(MPlexLV &par, const int N_proc)
bool g_debug
Definition: Debug.cc:2
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
float hipo(float x, float y)
Definition: Matrix.h:9
Material material_checked(float z, float r) const
Definition: TrackerInfo.h:240
void helixAtRFromIterativeCCS(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msRad, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
#define dprintf(...)
Definition: Debug.h:98

◆ propagateHelixToZMPlex()

void mkfit::propagateHelixToZMPlex ( const MPlexLS inErr,
const MPlexLV inPar,
const MPlexQI inChg,
const MPlexQF msZ,
MPlexLS outErr,
MPlexLV outPar,
MPlexQI outFailFlag,
const int  N_proc,
const PropagationFlags pflags,
const MPlexQI noMatEffPtr 
)

Definition at line 613 of file PropagationMPlex.cc.

References funct::abs(), mkfit::PropagationFlags::apply_material, applyMaterialEffects(), debug, dprintf, g_debug, helixAtZ(), Matriplex::hypot(), mps_fire::i, dqmiolumiharvest::j, GetRecoTauVFromDQM_MC_cff::kk, mkfit::TrackerInfo::material_checked(), dqmiodumpmetadata::n, NN, mkfit::TrackerInfo::Material::radl, squashPhiMPlex(), groupFilesInBlocks::temp, and mkfit::PropagationFlags::tracker_info.

Referenced by kalmanPropagateAndComputeChi2Endcap(), kalmanPropagateAndUpdateEndcap(), mkfit::MkBase::propagateTracksToHitZ(), mkfit::MkBase::propagateTracksToPCAZ(), and mkfit::MkBase::propagateTracksToZ().

622  {
623  // debug = true;
624 
625  outErr = inErr;
626  outPar = inPar;
627 
628  MPlexLL errorProp;
629 
630  //helixAtZ_new(inPar, inChg, msZ, outPar, errorProp, outFailFlag, N_proc, pflags);
631  helixAtZ(inPar, inChg, msZ, outPar, errorProp, outFailFlag, N_proc, pflags);
632 
633 #ifdef DEBUG
634  if (debug && g_debug) {
635  for (int kk = 0; kk < N_proc; ++kk) {
636  dprintf("inPar %d\n", kk);
637  for (int i = 0; i < 6; ++i) {
638  dprintf("%8f ", inPar.constAt(kk, i, 0));
639  }
640  dprintf("\n");
641 
642  dprintf("inErr %d\n", kk);
643  for (int i = 0; i < 6; ++i) {
644  for (int j = 0; j < 6; ++j)
645  dprintf("%8f ", inErr.constAt(kk, i, j));
646  dprintf("\n");
647  }
648  dprintf("\n");
649 
650  dprintf("errorProp %d\n", kk);
651  for (int i = 0; i < 6; ++i) {
652  for (int j = 0; j < 6; ++j)
653  dprintf("%8f ", errorProp.At(kk, i, j));
654  dprintf("\n");
655  }
656  dprintf("\n");
657  }
658  }
659 #endif
660 
661 #ifdef DEBUG
662  if (debug && g_debug) {
663  for (int kk = 0; kk < N_proc; ++kk) {
664  dprintf("outErr %d\n", kk);
665  for (int i = 0; i < 6; ++i) {
666  for (int j = 0; j < 6; ++j)
667  dprintf("%8f ", outErr.constAt(kk, i, j));
668  dprintf("\n");
669  }
670  dprintf("\n");
671  }
672  }
673 #endif
674 
675  // Matriplex version of: result.errors = ROOT::Math::Similarity(errorProp, outErr);
676  MPlexLL temp;
677  MultHelixPropEndcap(errorProp, outErr, temp);
678  MultHelixPropTranspEndcap(errorProp, temp, outErr);
679  // can replace with: MultHelixPropFull(errorProp, outErr, temp); MultHelixPropTranspFull(errorProp, temp, outErr);
680 
681  if (pflags.apply_material) {
682  MPlexQF hitsRl;
683  MPlexQF hitsXi;
684  MPlexQF propSign;
685 
686  const TrackerInfo& tinfo = *pflags.tracker_info;
687 
688 #pragma omp simd
689  for (int n = 0; n < NN; ++n) {
690  if (n >= N_proc || (noMatEffPtr && noMatEffPtr->constAt(n, 0, 0))) {
691  hitsRl(n, 0, 0) = 0.f;
692  hitsXi(n, 0, 0) = 0.f;
693  } else {
694  const float hypo = std::hypot(outPar(n, 0, 0), outPar(n, 1, 0));
695  auto mat = tinfo.material_checked(std::abs(msZ(n, 0, 0)), hypo);
696  hitsRl(n, 0, 0) = mat.radl;
697  hitsXi(n, 0, 0) = mat.bbxi;
698  }
699  if (n < N_proc) {
700  const float zout = msZ.constAt(n, 0, 0);
701  const float zin = inPar.constAt(n, 2, 0);
702  propSign(n, 0, 0) = (std::abs(zout) > std::abs(zin) ? 1.f : -1.f);
703  }
704  }
705  MPlexHV plNrm;
706 #pragma omp simd
707  for (int n = 0; n < NN; ++n) {
708  plNrm(n, 0, 0) = 0.f;
709  plNrm(n, 1, 0) = 0.f;
710  plNrm(n, 2, 0) = 1.f;
711  }
712  applyMaterialEffects(hitsRl, hitsXi, propSign, plNrm, outErr, outPar, N_proc);
713 #ifdef DEBUG
714  if (debug && g_debug) {
715  for (int kk = 0; kk < N_proc; ++kk) {
716  dprintf("propSign %d\n", kk);
717  for (int i = 0; i < 1; ++i) {
718  dprintf("%8f ", propSign.constAt(kk, i, 0));
719  }
720  dprintf("\n");
721  dprintf("plNrm %d\n", kk);
722  for (int i = 0; i < 3; ++i) {
723  dprintf("%8f ", plNrm.constAt(kk, i, 0));
724  }
725  dprintf("\n");
726  dprintf("outErr(after material) %d\n", kk);
727  for (int i = 0; i < 6; ++i) {
728  for (int j = 0; j < 6; ++j)
729  dprintf("%8f ", outErr.constAt(kk, i, j));
730  dprintf("\n");
731  }
732  dprintf("\n");
733  }
734  }
735 #endif
736  }
737 
738  squashPhiMPlex(outPar, N_proc); // ensure phi is between |pi|
739 
740  // PROP-FAIL-ENABLE To keep physics changes minimal, we always restore the
741  // state to input when propagation fails -- as was the default before.
742  // if (pflags.copy_input_state_on_fail) {
743  for (int i = 0; i < N_proc; ++i) {
744  if (outFailFlag(i, 0, 0)) {
745  outPar.copySlot(i, inPar);
746  outErr.copySlot(i, inErr);
747  }
748  }
749  // }
750  }
Matriplex::Matriplex< float, LL, LL, NN > MPlexLL
Definition: Matrix.h:48
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:436
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
Definition: Matrix.h:53
const TrackerInfo * tracker_info
void applyMaterialEffects(const MPlexQF &hitsRl, const MPlexQF &hitsXi, const MPlexQF &propSign, const MPlexHV &plNrm, MPlexLS &outErr, MPlexLV &outPar, const int N_proc)
void squashPhiMPlex(MPlexLV &par, const int N_proc)
bool g_debug
Definition: Debug.cc:2
void helixAtZ(const MPlexLV &inPar, const MPlexQI &inChg, const MPlexQF &msZ, MPlexLV &outPar, MPlexLL &errorProp, MPlexQI &outFailFlag, const int N_proc, const PropagationFlags &pflags)
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
Definition: Matrix.h:71
Material material_checked(float z, float r) const
Definition: TrackerInfo.h:240
#define dprintf(...)
Definition: Debug.h:98

◆ propagateLineToRMPlex()

void mkfit::propagateLineToRMPlex ( const MPlexLS psErr,
const MPlexLV psPar,
const MPlexHS msErr,
const MPlexHV msPar,
MPlexLS outErr,
MPlexLV outPar,
const int  N_proc 
)

Definition at line 19 of file PropagationMPlex.cc.

References A, B, dprint_np, hipo(), N, dqmiodumpmetadata::n, NN, AlCaHLTBitMon_ParallelJobs::p, DiDispStaMuonMonitor_cfi::pt, and mathSSE::sqrt().

25  {
26  // XXX Regenerate parts below with a script.
27 
28  const Matriplex::idx_t N = NN;
29 
30 #pragma omp simd
31  for (int n = 0; n < NN; ++n) {
32  const float cosA = (psPar[0 * N + n] * psPar[3 * N + n] + psPar[1 * N + n] * psPar[4 * N + n]) /
33  (std::sqrt((psPar[0 * N + n] * psPar[0 * N + n] + psPar[1 * N + n] * psPar[1 * N + n]) *
34  (psPar[3 * N + n] * psPar[3 * N + n] + psPar[4 * N + n] * psPar[4 * N + n])));
35  const float dr = (hipo(msPar[0 * N + n], msPar[1 * N + n]) - hipo(psPar[0 * N + n], psPar[1 * N + n])) / cosA;
36 
37  dprint_np(n, "propagateLineToRMPlex dr=" << dr);
38 
39  const float pt = hipo(psPar[3 * N + n], psPar[4 * N + n]);
40  const float p = dr / pt; // path
41  const float psq = p * p;
42 
43  outPar[0 * N + n] = psPar[0 * N + n] + p * psPar[3 * N + n];
44  outPar[1 * N + n] = psPar[1 * N + n] + p * psPar[4 * N + n];
45  outPar[2 * N + n] = psPar[2 * N + n] + p * psPar[5 * N + n];
46  outPar[3 * N + n] = psPar[3 * N + n];
47  outPar[4 * N + n] = psPar[4 * N + n];
48  outPar[5 * N + n] = psPar[5 * N + n];
49 
50  {
51  const MPlexLS& A = psErr;
52  MPlexLS& B = outErr;
53 
54  B.fArray[0 * N + n] = A.fArray[0 * N + n];
55  B.fArray[1 * N + n] = A.fArray[1 * N + n];
56  B.fArray[2 * N + n] = A.fArray[2 * N + n];
57  B.fArray[3 * N + n] = A.fArray[3 * N + n];
58  B.fArray[4 * N + n] = A.fArray[4 * N + n];
59  B.fArray[5 * N + n] = A.fArray[5 * N + n];
60  B.fArray[6 * N + n] = A.fArray[6 * N + n] + p * A.fArray[0 * N + n];
61  B.fArray[7 * N + n] = A.fArray[7 * N + n] + p * A.fArray[1 * N + n];
62  B.fArray[8 * N + n] = A.fArray[8 * N + n] + p * A.fArray[3 * N + n];
63  B.fArray[9 * N + n] =
64  A.fArray[9 * N + n] + p * (A.fArray[6 * N + n] + A.fArray[6 * N + n]) + psq * A.fArray[0 * N + n];
65  B.fArray[10 * N + n] = A.fArray[10 * N + n] + p * A.fArray[1 * N + n];
66  B.fArray[11 * N + n] = A.fArray[11 * N + n] + p * A.fArray[2 * N + n];
67  B.fArray[12 * N + n] = A.fArray[12 * N + n] + p * A.fArray[4 * N + n];
68  B.fArray[13 * N + n] =
69  A.fArray[13 * N + n] + p * (A.fArray[7 * N + n] + A.fArray[10 * N + n]) + psq * A.fArray[1 * N + n];
70  B.fArray[14 * N + n] =
71  A.fArray[14 * N + n] + p * (A.fArray[11 * N + n] + A.fArray[11 * N + n]) + psq * A.fArray[2 * N + n];
72  B.fArray[15 * N + n] = A.fArray[15 * N + n] + p * A.fArray[3 * N + n];
73  B.fArray[16 * N + n] = A.fArray[16 * N + n] + p * A.fArray[4 * N + n];
74  B.fArray[17 * N + n] = A.fArray[17 * N + n] + p * A.fArray[5 * N + n];
75  B.fArray[18 * N + n] =
76  A.fArray[18 * N + n] + p * (A.fArray[8 * N + n] + A.fArray[15 * N + n]) + psq * A.fArray[3 * N + n];
77  B.fArray[19 * N + n] =
78  A.fArray[19 * N + n] + p * (A.fArray[12 * N + n] + A.fArray[16 * N + n]) + psq * A.fArray[4 * N + n];
79  B.fArray[20 * N + n] =
80  A.fArray[20 * N + n] + p * (A.fArray[17 * N + n] + A.fArray[17 * N + n]) + psq * A.fArray[5 * N + n];
81  }
82 
83  dprint_np(n, "propagateLineToRMPlex arrive at r=" << hipo(outPar[0 * N + n], outPar[1 * N + n]));
84  }
85  }
Definition: APVGainStruct.h:7
#define dprint_np(n, x)
Definition: Debug.h:96
T sqrt(T t)
Definition: SSEVec.h:23
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
#define N
Definition: blowfish.cc:9
float hipo(float x, float y)
Definition: Matrix.h:9
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
Definition: Matrix.h:50
Definition: APVGainStruct.h:7

◆ run_OneIteration()

void mkfit::run_OneIteration ( const TrackerInfo trackerInfo,
const IterationConfig itconf,
const EventOfHits eoh,
const std::vector< const std::vector< bool > *> &  hit_masks,
MkBuilder builder,
TrackVec seeds,
TrackVec out_tracks,
bool  do_seed_clean,
bool  do_backward_fit,
bool  do_remove_duplicates 
)

Definition at line 29 of file runFunctions.cc.

References mkfit::MkBuilder::backwardFit(), mkfit::MkBuilder::begin_event(), mkfit::MkBuilder::beginBkwSearch(), mkfit::MkBuilder::compactifyHitStorageForBestCand(), mkfit::MkBuilder::end_event(), mkfit::MkBuilder::endBkwSearch(), mkfit::MkBuilder::export_best_comb_cands(), mkfit::MkBuilder::filter_comb_cands(), mkfit::MkBuilder::find_tracks_load_seeds(), mkfit::MkBuilder::findTracksCloneEngine(), mkfit::SteeringParams::IT_BkwSearch, mkfit::IterationConfig::m_backward_drop_seed_hits, mkfit::IterationConfig::m_backward_fit_min_hits, mkfit::IterationConfig::m_backward_search, mkfit::IterationConfig::m_duplicate_cleaner, mkfit::IterationConfig::m_post_bkfit_filter, mkfit::IterationConfig::m_pre_bkfit_filter, mkfit::IterationConfig::m_requires_seed_hit_sorting, mkfit::IterationConfig::m_seed_cleaner, mkfit::EventOfHits::refBeamSpot(), mkfit::MkBuilder::release_memory(), alignCSCRings::s, mkfit::MkBuilder::seed_post_cleaning(), and HLT_2024v14_cff::seeds.

Referenced by MkFitProducer::produce().

38  {
39  IterationMaskIfcCmssw it_mask_ifc(trackerInfo, hit_masks);
40 
41  MkJob job({trackerInfo, itconf, eoh, eoh.refBeamSpot(), &it_mask_ifc});
42 
43  builder.begin_event(&job, nullptr, __func__);
44 
45  // Seed cleaning not done on all iterations.
46  do_seed_clean = do_seed_clean && itconf.m_seed_cleaner;
47 
48  if (do_seed_clean)
49  itconf.m_seed_cleaner(seeds, itconf, eoh.refBeamSpot());
50 
51  // Check nans in seeds -- this should not be needed when Slava fixes
52  // the track parameter coordinate transformation.
53  builder.seed_post_cleaning(seeds);
54 
55  if (itconf.m_requires_seed_hit_sorting) {
56  for (auto &s : seeds)
57  s.sortHitsByLayer(); // sort seed hits for the matched hits (I hope it works here)
58  }
59 
60  builder.find_tracks_load_seeds(seeds, do_seed_clean);
61 
62  builder.findTracksCloneEngine();
63 
64  // Pre backward-fit filtering.
65  filter_candidates_func pre_filter;
66  if (do_backward_fit && itconf.m_pre_bkfit_filter)
67  pre_filter = [&](const TrackCand &tc, const MkJob &jb) -> bool {
68  return itconf.m_pre_bkfit_filter(tc, jb) && StdSeq::qfilter_nan_n_silly<TrackCand>(tc, jb);
69  };
70  else if (itconf.m_pre_bkfit_filter)
71  pre_filter = itconf.m_pre_bkfit_filter;
72  else if (do_backward_fit)
73  pre_filter = StdSeq::qfilter_nan_n_silly<TrackCand>;
74  // pre_filter can be null if we are not doing backward fit as nan_n_silly will be run below.
75  if (pre_filter)
76  builder.filter_comb_cands(pre_filter, true);
77 
78  job.switch_to_backward();
79 
80  if (do_backward_fit) {
81  if (itconf.m_backward_search) {
82  builder.compactifyHitStorageForBestCand(itconf.m_backward_drop_seed_hits, itconf.m_backward_fit_min_hits);
83  }
84 
85  builder.backwardFit();
86 
87  if (itconf.m_backward_search) {
88  builder.beginBkwSearch();
89  builder.findTracksCloneEngine(SteeringParams::IT_BkwSearch);
90  }
91  }
92 
93  // Post backward-fit filtering.
94  filter_candidates_func post_filter;
95  if (do_backward_fit && itconf.m_post_bkfit_filter)
96  post_filter = [&](const TrackCand &tc, const MkJob &jb) -> bool {
97  return itconf.m_post_bkfit_filter(tc, jb) && StdSeq::qfilter_nan_n_silly<TrackCand>(tc, jb);
98  };
99  else
100  post_filter = StdSeq::qfilter_nan_n_silly<TrackCand>;
101  // post_filter is always at least doing nan_n_silly filter.
102  builder.filter_comb_cands(post_filter, true);
103 
104  if (do_backward_fit && itconf.m_backward_search)
105  builder.endBkwSearch();
106 
107  builder.export_best_comb_cands(out_tracks, true);
108 
109  if (do_remove_duplicates && itconf.m_duplicate_cleaner) {
110  itconf.m_duplicate_cleaner(out_tracks, itconf);
111  }
112 
113  builder.end_event();
114  builder.release_memory();
115  }
std::function< filter_candidates_cf > filter_candidates_func
Definition: FunctionTypes.h:28

◆ runBtpCe_MultiIter()

std::vector< double > mkfit::runBtpCe_MultiIter ( Event ev,
const EventOfHits eoh,
MkBuilder builder,
int  n 
)

Definition at line 416 of file buildtestMPlex.cc.

References analysisFilters_cff::algorithms, mkfit::Config::backwardFit, mkfit::MkBuilder::backwardFit(), mkfit::Config::backwardSearch, mkfit::MkBuilder::begin_event(), mkfit::MkBuilder::beginBkwSearch(), nano_mu_local_reco_cff::bool, mkfit::Config::cmssw_val, mkfit::MkBuilder::compactifyHitStorageForBestCand(), dtime(), mkfit::MkBuilder::end_event(), mkfit::MkBuilder::endBkwSearch(), makeMEIFBenchmarkPlots::ev, mkfit::MkBuilder::export_tracks(), mkfit::MkBuilder::filter_comb_cands(), spr::find(), mkfit::MkBuilder::find_tracks_load_seeds(), mkfit::MkBuilder::findTracksCloneEngine(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, mkfit::SteeringParams::IT_BkwSearch, mkfit::Config::ItrInfo, mkfit::IterationConfig::m_backward_drop_seed_hits, mkfit::IterationConfig::m_backward_fit_min_hits, mkfit::IterationConfig::m_backward_search, mkfit::IterationConfig::m_duplicate_cleaner, mkfit::IterationMaskIfc::m_mask_vector, mkfit::IterationConfig::m_post_bkfit_filter, mkfit::IterationConfig::m_pre_bkfit_filter, mkfit::IterationConfig::m_requires_seed_hit_sorting, mkfit::IterationConfig::m_seed_cleaner, mkfit::IterationConfig::m_track_algorithm, eostools::move(), dqmiodumpmetadata::n, mkfit::StdSeq::prep_simtracks(), mkfit::StdSeq::Quality::quality_val(), mkfit::Config::quality_val, mkfit::MkBuilder::ref_tracks_nc(), mkfit::EventOfHits::refBeamSpot(), mkfit::MkBuilder::release_memory(), mkfit::StdSeq::root_val(), alignCSCRings::s, mkfit::MkBuilder::seed_post_cleaning(), HLT_2024v14_cff::seeds, mkfit::MkBuilder::select_best_comb_cands(), mkfit::Config::sim_val, submitPVValidationJobs::t, hcalRecHitTable_cff::time, and mkfit::Config::TrkInfo.

Referenced by test_standard().

416  {
417  std::vector<double> timevec;
418  if (n <= 0)
419  return timevec;
420  timevec.resize(n + 1, 0.0);
421 
422  const bool validation_on = (Config::sim_val || Config::quality_val);
423 
424  TrackVec seeds_used;
425  TrackVec seeds1;
426 
427  if (validation_on) {
428  for (auto const &s : ev.seedTracks_) {
429  //keep seeds form the first n iterations for processing
430  if (std::find(algorithms, algorithms + n, s.algoint()) != algorithms + n)
431  seeds1.push_back(s);
432  }
433  ev.seedTracks_.swap(seeds1); //necessary for the validation - PrepareSeeds
434  ev.relabel_bad_seedtracks(); //necessary for the validation - PrepareSeeds
435  }
436 
437  IterationMaskIfc mask_ifc;
438  TrackVec seeds;
439  TrackVec tmp_tvec;
440 
441  for (int it = 0; it <= n - 1; ++it) {
442  const IterationConfig &itconf = Config::ItrInfo[it];
443 
444  // To disable hit-masks, pass nullptr in place of &mask_ifc to MkJob ctor
445  // and optionally comment out ev.fill_hitmask_bool_vectors() call.
446 
447  ev.fill_hitmask_bool_vectors(itconf.m_track_algorithm, mask_ifc.m_mask_vector);
448 
449  MkJob job({Config::TrkInfo, itconf, eoh, eoh.refBeamSpot(), &mask_ifc});
450 
451  builder.begin_event(&job, &ev, __func__);
452 
453  { // We could partition seeds once, store beg, end for each iteration in a map or vector.
454  seeds.clear();
455  int nc = 0;
456  for (auto &s : ev.seedTracks_) {
457  if (s.algoint() == itconf.m_track_algorithm) {
458  if (itconf.m_requires_seed_hit_sorting) {
459  s.sortHitsByLayer();
460  }
461  seeds.push_back(s);
462  ++nc;
463  } else if (nc > 0)
464  break;
465  }
466  }
467 
468  bool do_seed_clean = bool(itconf.m_seed_cleaner);
469 
470  if (do_seed_clean)
471  itconf.m_seed_cleaner(seeds, itconf, eoh.refBeamSpot());
472 
473  builder.seed_post_cleaning(seeds);
474 
475  // Add protection in case no seeds are found for iteration
476  if (seeds.size() <= 0)
477  continue;
478  ev.setCurrentSeedTracks(seeds);
479 
480  builder.find_tracks_load_seeds(seeds, do_seed_clean);
481 
482  double time = dtime();
483 
484  builder.findTracksCloneEngine();
485 
486  timevec[it] = dtime() - time;
487  timevec[n] += timevec[it];
488 
489  // Print min and max size of hots vectors of CombCands.
490  // builder.find_min_max_hots_size();
491 
492  if (validation_on)
493  seeds_used.insert(seeds_used.end(), seeds.begin(), seeds.end()); //cleaned seeds need to be stored somehow
494 
495  // Pre backward-fit filtering.
496  // Note -- slightly different logic than run_OneIteration as we always do nan filters for
497  // export for validation.
498  filter_candidates_func pre_filter;
499  if (itconf.m_pre_bkfit_filter)
500  pre_filter = [&](const TrackCand &tc, const MkJob &jb) -> bool {
501  return itconf.m_pre_bkfit_filter(tc, jb) && StdSeq::qfilter_nan_n_silly<TrackCand>(tc, jb);
502  };
503  else
504  pre_filter = StdSeq::qfilter_nan_n_silly<TrackCand>;
505  // pre_filter is always at least doing nan_n_silly filter.
506  builder.filter_comb_cands(pre_filter, true);
507 
508  builder.select_best_comb_cands();
509 
510  {
511  builder.export_tracks(tmp_tvec);
512  if (itconf.m_duplicate_cleaner)
513  itconf.m_duplicate_cleaner(builder.ref_tracks_nc(), itconf);
514  ev.candidateTracks_.reserve(ev.candidateTracks_.size() + tmp_tvec.size());
515  for (auto &&t : tmp_tvec)
516  ev.candidateTracks_.emplace_back(std::move(t));
517  tmp_tvec.clear();
518  }
519 
520  job.switch_to_backward();
521 
522  // now do backwards fit... do we want to time this section?
523  if (Config::backwardFit) {
524  // a) TrackVec version:
525  // builder.backwardFitBH();
526 
527  // b) Version that runs on CombCand / TrackCand
528  const bool do_backward_search = Config::backwardSearch && itconf.m_backward_search;
529 
530  // We copy seed-hits into Candidates ... now we have to remove them so backward fit stops
531  // before reaching seeding region. Ideally, we wouldn't add them in the first place but
532  // if we want to export full tracks above we need to hold on to them (alternatively, we could
533  // have a pointer to seed track in CombCandidate and copy them from there).
534  if (do_backward_search)
535  builder.compactifyHitStorageForBestCand(itconf.m_backward_drop_seed_hits, itconf.m_backward_fit_min_hits);
536 
537  builder.backwardFit();
538 
539  if (do_backward_search) {
540  builder.beginBkwSearch();
541  builder.findTracksCloneEngine(SteeringParams::IT_BkwSearch);
542  }
543 
544  // Post backward-fit filtering.
545  // Note -- slightly different logic than run_OneIteration as we export both pre and post
546  // backward-fit tracks.
547  filter_candidates_func post_filter;
548  if (itconf.m_post_bkfit_filter)
549  post_filter = [&](const TrackCand &tc, const MkJob &jb) -> bool {
550  return itconf.m_post_bkfit_filter(tc, jb) && StdSeq::qfilter_nan_n_silly<TrackCand>(tc, jb);
551  };
552  else
553  post_filter = StdSeq::qfilter_nan_n_silly<TrackCand>;
554  // post_filter is always at least doing nan_n_silly filter.
555  builder.filter_comb_cands(post_filter, true);
556 
557  if (do_backward_search)
558  builder.endBkwSearch();
559 
560  builder.select_best_comb_cands(true); // true -> clear m_tracks as they were already filled once above
561 
562  if (itconf.m_duplicate_cleaner)
563  itconf.m_duplicate_cleaner(builder.ref_tracks_nc(), itconf);
564 
565  builder.export_tracks(ev.fitTracks_);
566  }
567  ev.resetCurrentSeedTracks();
568 
569  builder.end_event();
570  }
571 
572  // MIMI - Fake back event pointer for final processing (that should be done elsewhere)
573  MkJob job({Config::TrkInfo, Config::ItrInfo[0], eoh, eoh.refBeamSpot()});
574  builder.begin_event(&job, &ev, __func__);
575 
576  if (validation_on) {
578  //swap for the cleaned seeds
579  ev.seedTracks_.swap(seeds_used);
580  }
581 
582  check_nan_n_silly_candidates(ev);
583 
585  check_nan_n_silly_bkfit(ev);
586 
587  // validation section
588  if (Config::quality_val) {
589  StdSeq::Quality qval;
590  qval.quality_val(&ev);
591  } else if (Config::sim_val || Config::cmssw_val) {
593  }
594 
595  // ev.print_tracks(ev.candidateTracks_, true);
596 
597  // MIMI Unfake.
598  builder.end_event();
599 
600  // In CMSSW runOneIter we now release memory for comb-cands:
601  builder.release_memory();
602 
603  return timevec;
604  }
void root_val(Event *event)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
void prep_simtracks(Event *event)
std::function< filter_candidates_cf > filter_candidates_func
Definition: FunctionTypes.h:28
TrackerInfo TrkInfo
IterationsInfo ItrInfo
std::vector< Track > TrackVec
double dtime()
def move(src, dest)
Definition: eostools.py:511

◆ runBuildingTestPlexBestHit()

double mkfit::runBuildingTestPlexBestHit ( Event ev,
const EventOfHits eoh,
MkBuilder builder 
)

Definition at line 108 of file buildtestMPlex.cc.

References analysisFilters_cff::algorithms, mkfit::Config::backwardFit, mkfit::MkBuilder::backwardFitBH(), mkfit::MkBuilder::begin_event(), mkfit::Config::cmssw_val, dtime(), mkfit::MkBuilder::end_event(), makeMEIFBenchmarkPlots::ev, spr::find(), mkfit::MkBuilder::find_tracks_load_seeds_BH(), mkfit::MkBuilder::findTracksBestHit(), mkfit::Config::ItrInfo, mkfit::IterationMaskIfc::m_mask_vector, mkfit::IterationConfig::m_track_algorithm, mkfit::StdSeq::Quality::quality_val(), mkfit::Config::quality_val, mkfit::MkBuilder::ref_tracks(), mkfit::EventOfHits::refBeamSpot(), mkfit::StdSeq::root_val(), alignCSCRings::s, mkfit::Config::sim_val, hcalRecHitTable_cff::time, and mkfit::Config::TrkInfo.

Referenced by test_standard().

108  {
109  const IterationConfig &itconf = Config::ItrInfo[0];
110 
111  const bool validation_on = (Config::sim_val || Config::quality_val);
112 
113  TrackVec seeds1;
114  if (validation_on) {
115  unsigned int algorithms[] = {4}; //only initialStep
116 
117  for (auto const &s : ev.seedTracks_) {
118  //keep seeds form the first iteration for processing
119  if (std::find(algorithms, algorithms + 1, s.algoint()) != algorithms + 1)
120  seeds1.push_back(s);
121  }
122  ev.seedTracks_.swap(seeds1); //necessary for the validation - PrepareSeeds
123  ev.relabel_bad_seedtracks(); //necessary for the validation - PrepareSeeds
124  }
125 
126  IterationMaskIfc mask_ifc;
127 
128  // To disable hit-masks, pass nullptr in place of &mask_ifc to MkJob ctor
129  // and optionally comment out ev.fill_hitmask_bool_vectors() call.
130 
131  ev.fill_hitmask_bool_vectors(itconf.m_track_algorithm, mask_ifc.m_mask_vector);
132 
133  MkJob job({Config::TrkInfo, itconf, eoh, eoh.refBeamSpot(), &mask_ifc});
134 
135  builder.begin_event(&job, &ev, __func__);
136 
137  bool seeds_sorted = false;
138  // CCCC builder.PrepareSeeds();
139 
140  // EventOfCandidates event_of_cands;
141  builder.find_tracks_load_seeds_BH(ev.seedTracks_, seeds_sorted);
142 
143 #ifdef USE_VTUNE_PAUSE
144  __SSC_MARK(0x111); // use this to resume Intel SDE at the same point
145  __itt_resume();
146 #endif
147 
148  double time = dtime();
149 
150  builder.findTracksBestHit();
151 
152  time = dtime() - time;
153 
154 #ifdef USE_VTUNE_PAUSE
155  __itt_pause();
156  __SSC_MARK(0x222); // use this to pause Intel SDE at the same point
157 #endif
158 
159  // Hack, get the tracks out.
160  ev.candidateTracks_ = builder.ref_tracks();
161 
162  // For best hit, the candidateTracks_ vector is the direct input to the backward fit so only need to do clean_duplicates once
164  //Mark tracks as duplicates; if within CMSSW, remove duplicate tracks before backward fit
165  // CCCC if (Config::removeDuplicates) {
166  // CCCC StdSeq::clean_duplicates(ev.candidateTracks_);
167  // CCCC }
168  }
169 
170  job.switch_to_backward();
171 
172  // now do backwards fit... do we want to time this section?
173  if (Config::backwardFit) {
174  builder.backwardFitBH();
175  ev.fitTracks_ = builder.ref_tracks();
176  }
177 
178  if (Config::quality_val) {
179  StdSeq::Quality qval;
180  qval.quality_val(&ev);
181  } else if (Config::sim_val || Config::cmssw_val) {
183  }
184 
185  builder.end_event();
186 
187  // ev.print_tracks(ev.candidateTracks_, true);
188 
189  if (validation_on) {
190  ev.seedTracks_.swap(seeds1);
191  }
192 
193  return time;
194  }
void root_val(Event *event)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
TrackerInfo TrkInfo
IterationsInfo ItrInfo
std::vector< Track > TrackVec
double dtime()

◆ runBuildingTestPlexCloneEngine()

double mkfit::runBuildingTestPlexCloneEngine ( Event ev,
const EventOfHits eoh,
MkBuilder builder 
)

Definition at line 296 of file buildtestMPlex.cc.

References analysisFilters_cff::algorithms, mkfit::Config::backwardFit, mkfit::MkBuilder::backwardFitBH(), mkfit::MkBuilder::begin_event(), mkfit::Config::cmssw_val, dtime(), mkfit::MkBuilder::end_event(), makeMEIFBenchmarkPlots::ev, mkfit::MkBuilder::export_best_comb_cands(), spr::find(), mkfit::MkBuilder::find_tracks_load_seeds(), mkfit::MkBuilder::findTracksCloneEngine(), mkfit::Config::ItrInfo, mkfit::IterationMaskIfc::m_mask_vector, mkfit::IterationConfig::m_track_algorithm, mkfit::StdSeq::Quality::quality_val(), mkfit::Config::quality_val, mkfit::MkBuilder::ref_tracks(), mkfit::EventOfHits::refBeamSpot(), mkfit::StdSeq::root_val(), alignCSCRings::s, mkfit::MkBuilder::select_best_comb_cands(), mkfit::Config::sim_val, hcalRecHitTable_cff::time, and mkfit::Config::TrkInfo.

Referenced by test_standard().

296  {
297  const IterationConfig &itconf = Config::ItrInfo[0];
298 
299  const bool validation_on = (Config::sim_val || Config::quality_val);
300 
301  TrackVec seeds1;
302  if (validation_on) {
303  unsigned int algorithms[] = {4}; //only initialStep
304 
305  for (auto const &s : ev.seedTracks_) {
306  //keep seeds form the first iteration for processing
307  if (std::find(algorithms, algorithms + 1, s.algoint()) != algorithms + 1)
308  seeds1.push_back(s);
309  }
310  ev.seedTracks_.swap(seeds1); //necessary for the validation - PrepareSeeds
311  ev.relabel_bad_seedtracks(); //necessary for the validation - PrepareSeeds
312  }
313 
314  IterationMaskIfc mask_ifc;
315 
316  // To disable hit-masks, pass nullptr in place of &mask_ifc to MkJob ctor
317  // and optionally comment out ev.fill_hitmask_bool_vectors() call.
318 
319  ev.fill_hitmask_bool_vectors(itconf.m_track_algorithm, mask_ifc.m_mask_vector);
320 
321  MkJob job({Config::TrkInfo, itconf, eoh, eoh.refBeamSpot(), &mask_ifc});
322 
323  builder.begin_event(&job, &ev, __func__);
324 
325  bool seeds_sorted = false;
326  // CCCC builder.PrepareSeeds();
327  ev.setCurrentSeedTracks(ev.seedTracks_);
328 
329  builder.find_tracks_load_seeds(ev.seedTracks_, seeds_sorted);
330 
331 #ifdef USE_VTUNE_PAUSE
332  __SSC_MARK(0x111); // use this to resume Intel SDE at the same point
333  __itt_resume();
334 #endif
335 
336  double time = dtime();
337 
338  builder.findTracksCloneEngine();
339 
340  time = dtime() - time;
341 
342 #ifdef USE_VTUNE_PAUSE
343  __itt_pause();
344  __SSC_MARK(0x222); // use this to pause Intel SDE at the same point
345 #endif
346 
347  check_nan_n_silly_candidates(ev);
348 
349  // first store candidate tracks - needed for BH backward fit and root_validation
350  ev.candidateTracks_.clear();
351  builder.export_best_comb_cands(ev.candidateTracks_);
352 
353  job.switch_to_backward();
354 
355  // now do backwards fit... do we want to time this section?
356  if (Config::backwardFit) {
357  // a) TrackVec version:
358  builder.select_best_comb_cands();
359  builder.backwardFitBH();
360  ev.fitTracks_ = builder.ref_tracks();
361 
362  // b) Version that runs on CombCand / TrackCand
363  // builder.backwardFit();
364  // builder.quality_store_tracks(ev.fitTracks_);
365 
366  check_nan_n_silly_bkfit(ev);
367  }
368 
369  // CCCC StdSeq::handle_duplicates(&ev);
370 
371  // validation section
372  if (Config::quality_val) {
373  StdSeq::Quality qval;
374  qval.quality_val(&ev);
375  } else if (Config::sim_val || Config::cmssw_val) {
377  }
378 
379  ev.resetCurrentSeedTracks();
380 
381  builder.end_event();
382 
383  // ev.print_tracks(ev.candidateTracks_, true);
384 
385  if (validation_on) {
386  ev.seedTracks_.swap(seeds1);
387  }
388 
389  return time;
390  }
void root_val(Event *event)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
TrackerInfo TrkInfo
IterationsInfo ItrInfo
std::vector< Track > TrackVec
double dtime()

◆ runBuildingTestPlexDumbCMSSW()

void mkfit::runBuildingTestPlexDumbCMSSW ( Event ev,
const EventOfHits eoh,
MkBuilder builder 
)

Definition at line 90 of file buildtestMPlex.cc.

References mkfit::MkBuilder::begin_event(), mkfit::MkBuilder::end_event(), makeMEIFBenchmarkPlots::ev, mkfit::Config::ItrInfo, mkfit::EventOfHits::refBeamSpot(), mkfit::StdSeq::root_val_dumb_cmssw(), mkfit::Config::sim_val_for_cmssw, and mkfit::Config::TrkInfo.

Referenced by test_standard().

90  {
91  const IterationConfig &itconf = Config::ItrInfo[0];
92 
93  MkJob job({Config::TrkInfo, itconf, eoh, eoh.refBeamSpot()});
94 
95  builder.begin_event(&job, &ev, __func__);
96 
99  }
100 
101  builder.end_event();
102  }
TrackerInfo TrkInfo
IterationsInfo ItrInfo
void root_val_dumb_cmssw(Event *event)

◆ runBuildingTestPlexStandard()

double mkfit::runBuildingTestPlexStandard ( Event ev,
const EventOfHits eoh,
MkBuilder builder 
)

Definition at line 200 of file buildtestMPlex.cc.

References analysisFilters_cff::algorithms, mkfit::Config::backwardFit, mkfit::MkBuilder::backwardFitBH(), mkfit::MkBuilder::begin_event(), mkfit::Config::cmssw_val, dtime(), mkfit::MkBuilder::end_event(), makeMEIFBenchmarkPlots::ev, mkfit::MkBuilder::export_best_comb_cands(), spr::find(), mkfit::MkBuilder::find_tracks_load_seeds(), mkfit::MkBuilder::findTracksStandard(), mkfit::Config::ItrInfo, mkfit::IterationMaskIfc::m_mask_vector, mkfit::IterationConfig::m_track_algorithm, mkfit::StdSeq::Quality::quality_val(), mkfit::Config::quality_val, mkfit::MkBuilder::ref_tracks(), mkfit::EventOfHits::refBeamSpot(), mkfit::StdSeq::root_val(), alignCSCRings::s, mkfit::MkBuilder::select_best_comb_cands(), mkfit::Config::sim_val, hcalRecHitTable_cff::time, and mkfit::Config::TrkInfo.

Referenced by test_standard().

200  {
201  const IterationConfig &itconf = Config::ItrInfo[0];
202 
203  const bool validation_on = (Config::sim_val || Config::quality_val);
204 
205  TrackVec seeds1;
206  if (validation_on) {
207  unsigned int algorithms[] = {4}; //only initialStep
208 
209  for (auto const &s : ev.seedTracks_) {
210  //keep seeds form the first iteration for processing
211  if (std::find(algorithms, algorithms + 1, s.algoint()) != algorithms + 1)
212  seeds1.push_back(s);
213  }
214  ev.seedTracks_.swap(seeds1); //necessary for the validation - PrepareSeeds
215  ev.relabel_bad_seedtracks(); //necessary for the validation - PrepareSeeds
216  }
217 
218  IterationMaskIfc mask_ifc;
219 
220  // To disable hit-masks, pass nullptr in place of &mask_ifc to MkJob ctor
221  // and optionally comment out ev.fill_hitmask_bool_vectors() call.
222 
223  ev.fill_hitmask_bool_vectors(itconf.m_track_algorithm, mask_ifc.m_mask_vector);
224 
225  MkJob job({Config::TrkInfo, itconf, eoh, eoh.refBeamSpot(), &mask_ifc});
226 
227  builder.begin_event(&job, &ev, __func__);
228 
229  bool seeds_sorted = false;
230  // CCCC builder.PrepareSeeds();
231  ev.setCurrentSeedTracks(ev.seedTracks_);
232 
233  builder.find_tracks_load_seeds(ev.seedTracks_, seeds_sorted);
234 
235 #ifdef USE_VTUNE_PAUSE
236  __SSC_MARK(0x111); // use this to resume Intel SDE at the same point
237  __itt_resume();
238 #endif
239 
240  double time = dtime();
241 
242  builder.findTracksStandard();
243 
244  time = dtime() - time;
245 
246 #ifdef USE_VTUNE_PAUSE
247  __itt_pause();
248  __SSC_MARK(0x222); // use this to pause Intel SDE at the same point
249 #endif
250 
251  check_nan_n_silly_candidates(ev);
252 
253  // first store candidate tracks
254  ev.candidateTracks_.clear();
255  builder.export_best_comb_cands(ev.candidateTracks_);
256 
257  job.switch_to_backward();
258 
259  // now do backwards fit... do we want to time this section?
260  if (Config::backwardFit) {
261  // Using the TrackVec version until we home in on THE backward fit etc.
262  // builder.backwardFit();
263  builder.select_best_comb_cands();
264  builder.backwardFitBH();
265  ev.fitTracks_ = builder.ref_tracks();
266 
267  check_nan_n_silly_bkfit(ev);
268  }
269 
270  // CCCC StdSeq::handle_duplicates(&ev);
271 
272  if (Config::quality_val) {
273  StdSeq::Quality qval;
274  qval.quality_val(&ev);
275  } else if (Config::sim_val || Config::cmssw_val) {
277  }
278 
279  ev.resetCurrentSeedTracks();
280 
281  builder.end_event();
282 
283  // ev.print_tracks(ev.candidateTracks_, true);
284 
285  if (validation_on) {
286  ev.seedTracks_.swap(seeds1);
287  }
288 
289  return time;
290  }
void root_val(Event *event)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
TrackerInfo TrkInfo
IterationsInfo ItrInfo
std::vector< Track > TrackVec
double dtime()

◆ runFittingTestPlex()

double mkfit::runFittingTestPlex ( Event ev,
std::vector< Track > &  rectracks 
)

Definition at line 40 of file fittestMPlex.cc.

References submitPVResolutionJobs::count, dtime(), makeMEIFBenchmarkPlots::ev, mkfit::Config::fit_val, g_exe_ctx, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, mkfit::ExecutionContext::m_fitters, SiStripPI::max, mkfit::Config::nLayers, NN, mkfit::Config::numSeedsPerTask, mkfit::Config::numThreadsFinder, mkfit::ExecutionContext::populate(), and hcalRecHitTable_cff::time.

40  {
42  std::vector<Track>& simtracks = ev.simTracks_;
43 
44  const int Nhits = Config::nLayers;
45  // XXX What if there's a missing / double layer?
46  // Eventually, should sort track vector by number of hits!
47  // And pass the number in on each "setup" call.
48  // Reserves should be made for maximum possible number (but this is just
49  // measurments errors, params).
50 
51  int theEnd = simtracks.size();
52  int count = (theEnd + NN - 1) / NN;
53 
54 #ifdef USE_VTUNE_PAUSE
55  __SSC_MARK(0x111); // use this to resume Intel SDE at the same point
56  __itt_resume();
57 #endif
58 
59  double time = dtime();
60 
61  tbb::parallel_for(tbb::blocked_range<int>(0, count, std::max(1, Config::numSeedsPerTask / NN)),
62  [&](const tbb::blocked_range<int>& i) {
63  std::unique_ptr<MkFitter, decltype(retfitr)> mkfp(g_exe_ctx.m_fitters.GetFromPool(), retfitr);
64  mkfp->setNhits(Nhits);
65  for (int it = i.begin(); it < i.end(); ++it) {
66  int itrack = it * NN;
67  int end = itrack + NN;
68  /*
69  * MT, trying to slurp and fit at the same time ...
70  if (theEnd < end) {
71  end = theEnd;
72  mkfp->inputTracksAndHits(simtracks, ev.layerHits_, itrack, end);
73  } else {
74  mkfp->slurpInTracksAndHits(simtracks, ev.layerHits_, itrack, end); // only safe for a full matriplex
75  }
76 
77  if (Config::cf_fitting) mkfp->ConformalFitTracks(true, itrack, end);
78  mkfp->FitTracks(end - itrack, &ev, true);
79  */
80 
81  mkfp->inputTracksForFit(simtracks, itrack, end);
82 
83  // XXXX MT - for this need 3 points in ... right
84  // XXXX if (Config::cf_fitting) mkfp->ConformalFitTracks(true, itrack, end);
85 
86  mkfp->fitTracksWithInterSlurp(ev.layerHits_, end - itrack);
87 
88  mkfp->outputFittedTracks(rectracks, itrack, end);
89  }
90  });
91 
92  time = dtime() - time;
93 
94 #ifdef USE_VTUNE_PAUSE
95  __itt_pause();
96  __SSC_MARK(0x222); // use this to pause Intel SDE at the same point
97 #endif
98 
99  if (Config::fit_val)
100  ev.validate();
101 
102  return time;
103  }
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
ExecutionContext g_exe_ctx
Definition: MkBuilder.cc:55
constexpr int numThreadsFinder
Definition: Config.h:87
Pool< MkFitter > m_fitters
Definition: MkBuilder.cc:39
void populate(int n_thr)
Definition: MkBuilder.cc:42
double dtime()
constexpr int numSeedsPerTask
Definition: Config.h:89

◆ sincos4()

void mkfit::sincos4 ( const float  x,
float &  sin,
float &  cos 
)
inline

Definition at line 13 of file Matrix.h.

References funct::cos(), funct::sin(), and x.

Referenced by helixAtRFromIterativeCCSFullJac(), and helixAtZ().

13  {
14  // Had this writen with explicit division by factorial.
15  // The *whole* fitting test ran like 2.5% slower on MIC, sigh.
16 
17  const float x2 = x * x;
18  cos = 1.f - 0.5f * x2 + 0.04166667f * x2 * x2;
19  sin = x - 0.16666667f * x * x2;
20  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float x

◆ sortByEta()

bool mkfit::sortByEta ( const Hit hit1,
const Hit hit2 
)
inline

Definition at line 25 of file buildtestMPlex.cc.

References mkfit::Hit::eta().

25 { return hit1.eta() < hit2.eta(); }

◆ sortByHitsChi2() [1/2]

bool mkfit::sortByHitsChi2 ( const std::pair< Track, TrackState > &  cand1,
const std::pair< Track, TrackState > &  cand2 
)
inline

Definition at line 14 of file buildtestMPlex.cc.

14  {
15  if (cand1.first.nFoundHits() == cand2.first.nFoundHits())
16  return cand1.first.chi2() < cand2.first.chi2();
17 
18  return cand1.first.nFoundHits() > cand2.first.nFoundHits();
19  }

◆ sortByHitsChi2() [2/2]

bool mkfit::sortByHitsChi2 ( const Track cand1,
const Track cand2 
)
inline

Definition at line 585 of file Track.h.

References mkfit::TrackBase::chi2(), and mkfit::Track::nFoundHits().

585  {
586  if (cand1.nFoundHits() == cand2.nFoundHits())
587  return cand1.chi2() < cand2.chi2();
588  return cand1.nFoundHits() > cand2.nFoundHits();
589  }

◆ sortByPhi()

bool mkfit::sortByPhi ( const Hit hit1,
const Hit hit2 
)
inline

Definition at line 21 of file buildtestMPlex.cc.

References mkfit::Hit::x(), and mkfit::Hit::y().

21  {
22  return std::atan2(hit1.y(), hit1.x()) < std::atan2(hit2.y(), hit2.x());
23  }

◆ sortByScoreCand()

bool mkfit::sortByScoreCand ( const Track cand1,
const Track cand2 
)
inline

Definition at line 591 of file Track.h.

References mkfit::TrackBase::score().

Referenced by mkfit::TTreeValidation::mapRefTkToRecoTks().

591 { return cand1.score() > cand2.score(); }

◆ sortByScoreStruct()

bool mkfit::sortByScoreStruct ( const IdxChi2List cand1,
const IdxChi2List cand2 
)
inline

Definition at line 593 of file Track.h.

References mkfit::IdxChi2List::score.

593  {
594  return cand1.score > cand2.score;
595  }

◆ sortByScoreTrackCand()

bool mkfit::sortByScoreTrackCand ( const TrackCand cand1,
const TrackCand cand2 
)
inline

Definition at line 255 of file TrackStructures.h.

References mkfit::TrackBase::score().

Referenced by mkfit::CombCandidate::mergeCandsAndBestShortOne(), and mkfit::CandCloner::processSeedRange().

255  {
256  return cand1.score() > cand2.score();
257  }

◆ sortByZ()

bool mkfit::sortByZ ( const Hit hit1,
const Hit hit2 
)
inline

Definition at line 43 of file buildtestMPlex.cc.

References mkfit::Hit::z().

43 { return hit1.z() < hit2.z(); }
double z
global z - AlignmentGeometry::z0, mm
Definition: HitCollection.h:27

◆ sortIDsByChi2()

bool mkfit::sortIDsByChi2 ( const idchi2Pair cand1,
const idchi2Pair cand2 
)
inline

Definition at line 235 of file TrackExtra.cc.

Referenced by mkfit::TrackExtra::setCMSSWTrackIDInfoByTrkParams().

235 { return cand1.second < cand2.second; }

◆ sortTracksByEta()

bool mkfit::sortTracksByEta ( const Track track1,
const Track track2 
)
inline

Definition at line 27 of file buildtestMPlex.cc.

References mkfit::TrackBase::momEta().

27 { return track1.momEta() < track2.momEta(); }

◆ sortTracksByPhi()

bool mkfit::sortTracksByPhi ( const Track track1,
const Track track2 
)
inline

Definition at line 29 of file buildtestMPlex.cc.

References mkfit::TrackBase::momPhi().

29 { return track1.momPhi() < track2.momPhi(); }

◆ sqr()

template<typename T >
T mkfit::sqr ( T  x)
inline

Definition at line 14 of file Hit.h.

References x.

14  {
15  return x * x;
16  }
float x

◆ squashPhiGeneral() [1/2]

float mkfit::squashPhiGeneral ( float  phi)
inline

◆ squashPhiGeneral() [2/2]

template<typename Vector >
void mkfit::squashPhiGeneral ( Vector v)
inline

Definition at line 631 of file Track.h.

References mps_fire::i, squashPhiGeneral(), and findQualityFiles::v.

631  {
632  const int i = v.kSize - 2; // phi index
633  v[i] = squashPhiGeneral(v[i]);
634  }
void squashPhiGeneral(Vector &v)
Definition: Track.h:631

◆ squashPhiMinimal()

float mkfit::squashPhiMinimal ( float  phi)
inline

◆ squashPhiMPlex()

void mkfit::squashPhiMPlex ( MPlexLV par,
const int  N_proc 
)
inline

Definition at line 10 of file PropagationMPlex.h.

References dqmiodumpmetadata::n, NN, mkfit::Const::PI, and mkfit::Const::TwoPI.

Referenced by kalmanOperation(), kalmanOperationEndcap(), kalmanOperationPlane(), propagateHelixToPlaneMPlex(), propagateHelixToRMPlex(), and propagateHelixToZMPlex().

10  {
11 #pragma omp simd
12  for (int n = 0; n < NN; ++n) {
13  if (n < N_proc) {
14  if (par(n, 4, 0) >= Const::PI)
15  par(n, 4, 0) -= Const::TwoPI;
16  if (par(n, 4, 0) < -Const::PI)
17  par(n, 4, 0) += Const::TwoPI;
18  }
19  }
20  }
constexpr float TwoPI
Definition: Config.h:8
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
#define PI
Definition: QcdUeDQM.h:37

◆ squashPhiMPlexGeneral()

void mkfit::squashPhiMPlexGeneral ( MPlexLV par,
const int  N_proc 
)
inline

Definition at line 22 of file PropagationMPlex.h.

References f, mkfit::Const::InvPI, dqmiodumpmetadata::n, NN, mkfit::Const::PI, and mkfit::Const::TwoPI.

22  {
23 #pragma omp simd
24  for (int n = 0; n < NN; ++n) {
25  par(n, 4, 0) -= std::floor(0.5f * Const::InvPI * (par(n, 4, 0) + Const::PI)) * Const::TwoPI;
26  }
27  }
constexpr float TwoPI
Definition: Config.h:8
constexpr Matriplex::idx_t NN
Definition: Matrix.h:43
double f[11][100]
#define PI
Definition: QcdUeDQM.h:37
constexpr float InvPI
Definition: Config.h:12

◆ state2mom()

RVec mkfit::state2mom ( const miprops::State s)

Definition at line 14 of file RntConversions.h.

References alignCSCRings::s.

Referenced by mkfit::MkFinder::selectHitIndicesV2(), and state2state().

14 { return {s.px, s.py, s.pz}; }

◆ state2pos()

RVec mkfit::state2pos ( const miprops::State s)

Definition at line 13 of file RntConversions.h.

References alignCSCRings::s.

Referenced by mkfit::MkFinder::selectHitIndicesV2(), and state2state().

13 { return {s.x, s.y, s.z}; }

◆ state2state()

State mkfit::state2state ( const miprops::State s)

Definition at line 15 of file RntConversions.h.

References alignCSCRings::s, state2mom(), and state2pos().

15 { return {state2pos(s), state2mom(s)}; }
RVec state2mom(const miprops::State &s)
RVec state2pos(const miprops::State &s)

◆ statep2mom()

RVec mkfit::statep2mom ( const miprops::StatePlex s,
int  i 
)

Definition at line 18 of file RntConversions.h.

References mps_fire::i, and alignCSCRings::s.

Referenced by statep2state().

18 { return {s.px[i], s.py[i], s.pz[i]}; }

◆ statep2pos()

RVec mkfit::statep2pos ( const miprops::StatePlex s,
int  i 
)

Definition at line 17 of file RntConversions.h.

References mps_fire::i, and alignCSCRings::s.

Referenced by statep2state().

17 { return {s.x[i], s.y[i], s.z[i]}; }

◆ statep2propstate()

PropState mkfit::statep2propstate ( const miprops::StatePlex s,
int  i 
)

Definition at line 20 of file RntConversions.h.

References mps_fire::i, alignCSCRings::s, and statep2state().

Referenced by mkfit::MkFinder::selectHitIndicesV2().

20  {
21  return {statep2state(s, i), s.dalpha[i], s.fail_flag[i]};
22  }
State statep2state(const miprops::StatePlex &s, int i)

◆ statep2state()

State mkfit::statep2state ( const miprops::StatePlex s,
int  i 
)

Definition at line 19 of file RntConversions.h.

References mps_fire::i, alignCSCRings::s, statep2mom(), and statep2pos().

Referenced by statep2propstate().

19 { return {statep2pos(s, i), statep2mom(s, i)}; }
RVec statep2mom(const miprops::StatePlex &s, int i)
RVec statep2pos(const miprops::StatePlex &s, int i)

◆ to_json() [1/12]

void mkfit::to_json ( nlohmann::ordered_json &  nlohmann_json_j,
const mkfit::LayerControl nlohmann_json_t 
)
inline

Definition at line 37 of file IterationConfig.cc.

◆ to_json() [2/12]

void mkfit::to_json ( nlohmann::json nlohmann_json_j,
const mkfit::LayerControl nlohmann_json_t 
)
inline

Definition at line 37 of file IterationConfig.cc.

Referenced by mkfit::ConfigJson::save_Iterations().

◆ to_json() [3/12]

void mkfit::to_json ( nlohmann::ordered_json &  nlohmann_json_j,
const mkfit::SteeringParams nlohmann_json_t 
)
inline

Definition at line 45 of file IterationConfig.cc.

◆ to_json() [4/12]

void mkfit::to_json ( nlohmann::json nlohmann_json_j,
const mkfit::SteeringParams nlohmann_json_t 
)
inline

Definition at line 45 of file IterationConfig.cc.

◆ to_json() [5/12]

void mkfit::to_json ( nlohmann::json nlohmann_json_j,
const mkfit::IterationLayerConfig nlohmann_json_t 
)
inline

Definition at line 54 of file IterationConfig.cc.

◆ to_json() [6/12]

void mkfit::to_json ( nlohmann::ordered_json &  nlohmann_json_j,
const mkfit::IterationLayerConfig nlohmann_json_t 
)
inline

Definition at line 54 of file IterationConfig.cc.

◆ to_json() [7/12]

void mkfit::to_json ( nlohmann::json nlohmann_json_j,
const mkfit::IterationParams nlohmann_json_t 
)
inline

Definition at line 68 of file IterationConfig.cc.

◆ to_json() [8/12]

void mkfit::to_json ( nlohmann::ordered_json &  nlohmann_json_j,
const mkfit::IterationParams nlohmann_json_t 
)
inline

Definition at line 68 of file IterationConfig.cc.

◆ to_json() [9/12]

void mkfit::to_json ( nlohmann::ordered_json &  nlohmann_json_j,
const mkfit::IterationConfig nlohmann_json_t 
)
inline

Definition at line 101 of file IterationConfig.cc.

◆ to_json() [10/12]

void mkfit::to_json ( nlohmann::json nlohmann_json_j,
const mkfit::IterationConfig nlohmann_json_t 
)
inline

Definition at line 101 of file IterationConfig.cc.

◆ to_json() [11/12]

void mkfit::to_json ( nlohmann::json nlohmann_json_j,
const mkfit::IterationsInfo nlohmann_json_t 
)
inline

Definition at line 104 of file IterationConfig.cc.

110 {

◆ to_json() [12/12]

void mkfit::to_json ( nlohmann::ordered_json &  nlohmann_json_j,
const mkfit::IterationsInfo nlohmann_json_t 
)
inline

Definition at line 104 of file IterationConfig.cc.

References CMS_SA_ALLOW, and mutex.

110 {

◆ track2mom()

RVec mkfit::track2mom ( const TrackBase s)

Definition at line 26 of file RntConversions.h.

References alignCSCRings::s.

Referenced by track2state().

26 { return {s.px(), s.py(), s.pz()}; }

◆ track2pos()

RVec mkfit::track2pos ( const TrackBase s)

Definition at line 25 of file RntConversions.h.

References alignCSCRings::s.

Referenced by track2state().

25 { return {s.x(), s.y(), s.z()}; }

◆ track2state()

State mkfit::track2state ( const TrackBase s)

Definition at line 27 of file RntConversions.h.

References alignCSCRings::s, track2mom(), and track2pos().

Referenced by evsi2ssinfo().

27 { return {track2pos(s), track2mom(s)}; }
RVec track2pos(const TrackBase &s)
RVec track2mom(const TrackBase &s)

Variable Documentation

◆ g_debug

bool mkfit::g_debug = true

◆ g_exe_ctx

ExecutionContext mkfit::g_exe_ctx

◆ HH

constexpr Matriplex::idx_t mkfit::HH = 3

Definition at line 46 of file Matrix.h.

Referenced by L1TConfigDumper::analyze().

◆ LL

constexpr Matriplex::idx_t mkfit::LL = 6

◆ MPlexHitIdxMax

constexpr int mkfit::MPlexHitIdxMax = 16
static

Definition at line 12 of file MkFitter.h.

◆ NN

constexpr Matriplex::idx_t mkfit::NN = 8

Definition at line 43 of file Matrix.h.

Referenced by mkfit::MkFinder::addBestHit(), L1NNTauProducer::addTau(), L1TConfigDumper::analyze(), applyMaterialEffects(), mkfit::MkFinder::bkFitFitTracks(), mkfit::MkFinder::bkFitFitTracksBH(), CFMap(), conformalFitMPlex(), mkfit::MkFinder::copyOutParErr(), mkfit::MkBuilder::find_tracks_in_layers(), mkfit::MkFinder::findCandidates(), mkfit::MkFinder::findCandidatesCloneEngine(), mkfit::MkBuilder::findTracksBestHit(), mkfit::MkBuilder::findTracksStandard(), mkfit::MkBuilder::fit_cands(), mkfit::MkBuilder::fit_cands_BH(), helixAtPlane(), helixAtRFromIterativeCCS(), helixAtRFromIterativeCCSFullJac(), helixAtZ(), kalmanOperation(), kalmanOperationPlane(), kalmanPropagateAndComputeChi2(), kalmanPropagateAndComputeChi2Endcap(), kalmanPropagateAndUpdate(), kalmanPropagateAndUpdateEndcap(), kalmanPropagateAndUpdatePlane(), mkfit::MatriplexPackerSlurpIn< D >::pack(), mkfit::MatriplexErrParPackerSlurpIn< T, D >::pack(), mkfit::MkFinder::packModuleNormDir(), mkfit::MkFitter::printPt(), L1BJetProducer::produce(), propagateHelixToPlaneMPlex(), propagateHelixToRMPlex(), propagateHelixToZMPlex(), propagateLineToRMPlex(), mkfit::MkBase::propagateTracksToHitR(), mkfit::MkBase::propagateTracksToHitZ(), mkfit::MkBase::propagateTracksToPCAZ(), mkfit::MkBase::propagateTracksToR(), mkfit::MkBase::propagateTracksToZ(), runFittingTestPlex(), gen::TauolappInterface::selectHadronic(), mkfit::MkFinder::selectHitIndices(), mkfit::MkFinder::selectHitIndicesV2(), squashPhiMPlex(), and squashPhiMPlexGeneral().