SND@LHC Software
Loading...
Searching...
No Matches
genfit Namespace Reference

Matrix inversion tools. More...

Namespaces

namespace  RKTools
 Array matrix multiplications used in RKTrackRep.
 
namespace  tools
 

Classes

class  AbsBField
 Abstract Interface to magnetic fields in GENFIT. More...
 
class  AbsFinitePlane
 Abstract base class for finite detector planes. More...
 
class  AbsFitter
 Abstract base class for fitters. More...
 
class  AbsFitterInfo
 This class collects all information needed and produced by a specific AbsFitter and is specific to one AbsTrackRep of the Track. More...
 
class  AbsHMatrix
 HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane. More...
 
class  AbsKalmanFitter
 Abstract base class for Kalman fitter and derived fitting algorithms. More...
 
class  AbsMaterialInterface
 Abstract base class for geometry interfacing. More...
 
class  AbsMeasurement
 Contains the measurement and covariance in raw detector coordinates. More...
 
class  AbsMeasurementProducer
 Abstract interface class for MeasurementProducer. More...
 
class  AbsTrackRep
 Abstract base class for a track representation. More...
 
class  BellField
 Bell Field for SHiP. More...
 
class  ConstField
 Constant Magnetic field. More...
 
class  DAF
 Determinstic Annealing Filter (DAF) implementation. More...
 
class  DetPlane
 Detector plane. More...
 
class  EventDisplay
 Event display designed to run with Genfit. More...
 
class  Exception
 Exception class for error handling in GENFIT (provides storage for diagnostic information) More...
 
struct  ExtrapStep
 Helper for RKTrackRep. More...
 
class  FairShipFields
 Field for SHiP. More...
 
struct  fieldCache
 Cache B field at a position. Used by FieldManager. More...
 
class  FieldManager
 Singleton which provides access to magnetic field maps. More...
 
class  FitStatus
 Class where important numbers and properties of a fit can be stored. More...
 
class  FullMeasurement
 Measurement class implementing a measurement of all track parameters. More...
 
class  GFGbl
 Generic GBL implementation. More...
 
class  GFRaveMagneticField
 GFRaveMagneticField class Uses the FieldManager to provide a magnetic field to rave. More...
 
class  GFRavePropagator
 GFRavePropagator class. More...
 
class  GFRaveTrackParameters
 GFRaveTrackParameters class Contains a pointer to the original genfit::Track, the weight of the track in the vertex, and smoothed (with the vertex information) state and covariance of the track. More...
 
class  GFRaveVertex
 GFRaveVertex class. More...
 
class  GFRaveVertexFactory
 Vertex factory for producing GFRaveVertex objects from Track objects. More...
 
class  GoliathField
 Constant Magnetic field. More...
 
class  HelixTrackModel
 Helix track model for testing purposes. More...
 
class  HMatrixPhi
 AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization. More...
 
class  HMatrixU
 AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization. More...
 
class  HMatrixUnit
 AbsHMatrix implementation for 5-dimensional MeasurementOnPlane and RKTrackRep parameterization. More...
 
class  HMatrixUV
 AbsHMatrix implementation for two-dimensional MeasurementOnPlane and RKTrackRep parameterization. More...
 
class  HMatrixV
 AbsHMatrix implementation for one-dimensional MeasurementOnPlane and RKTrackRep parameterization. More...
 
class  KalmanFitStatus
 FitStatus for use with AbsKalmanFitter implementations. More...
 
class  KalmanFittedStateOnPlane
 MeasuredStateOnPlane with additional info produced by a Kalman filter or DAF. More...
 
class  KalmanFitter
 Simple Kalman filter implementation. More...
 
class  KalmanFitterInfo
 Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one AbsTrackRep of the Track. More...
 
class  KalmanFitterRefTrack
 Kalman filter implementation with linearization around a reference track. More...
 
class  MaterialEffects
 Stepper and energy loss/noise matrix calculation. More...
 
class  MaterialProperties
 Material properties needed e.g. for material effects calculation. More...
 
struct  MatStep
 Simple struct containing MaterialProperties and stepsize in the material. More...
 
class  MeasuredStateOnPlane
 StateOnPlane with additional covariance matrix. More...
 
class  MeasurementCreator
 Create different measurement types along a HelixTrackModel for testing purposes. More...
 
class  MeasurementFactory
 Factory object to create AbsMeasurement objects from digitized and clustered data. More...
 
class  MeasurementOnPlane
 Measured coordinates on a plane. More...
 
class  MeasurementProducer
 Template class for a measurement producer module. More...
 
class  mySpacepointDetectorHit
 Example class for a spacepoint detector hit. More...
 
class  mySpacepointMeasurement
 Example class for a spacepoint measurement which can be created from mySpacepointDetectorHit via the MeasurementFactory. More...
 
class  PlanarMeasurement
 Measurement class implementing a planar hit geometry (1 or 2D). More...
 
class  ProlateSpacepointMeasurement
 Class for measurements implementing a space point hit geometry with a very prolate form of the covariance matrix. More...
 
class  RectangularFinitePlane
 Rectangular finite plane. More...
 
class  ReferenceStateOnPlane
 StateOnPlane with linearized transport to that ReferenceStateOnPlane from previous and next ReferenceStateOnPlane More...
 
struct  RKStep
 Helper for RKTrackRep. More...
 
class  RKTrackRep
 AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v) More...
 
class  SpacepointMeasurement
 Class for measurements implementing a space point hit geometry. More...
 
class  StateOnPlane
 A state with arbitrary dimension defined in a DetPlane. More...
 
class  StepLimits
 Helper to store different limits on the stepsize for the RKTRackRep. More...
 
class  TGeoMaterialInterface
 AbsMaterialInterface implementation for use with ROOT's TGeoManager. More...
 
class  ThinScatterer
 Thin or thick scatterer. More...
 
class  Track
 Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects. More...
 
struct  trackAndState
 Simple struct containing a Track pointer and a MeasuredStateOnPlane. Used in GFRave. More...
 
class  TrackCand
 Track candidate – seed values and indices. More...
 
class  TrackCandHit
 Hit object for use in TrackCand. Provides IDs and sorting parameters. More...
 
class  TrackPoint
 Object containing AbsMeasurement and AbsFitterInfo objects. More...
 
class  TrackPointComparator
 Helper class for TrackPoint sorting, used in Track::sort(). More...
 
class  WireMeasurement
 Class for measurements in wire detectors (Straw tubes and drift chambers) which do not measure the coordinate along the wire. More...
 
class  WirePointMeasurement
 Class for measurements in wire detectors (Straw tubes and drift chambers) which can measure the coordinate along the wire. More...
 
class  WireTrackCandHit
 Hit object for use in TrackCand. Provides additional left/right parameter. More...
 

Typedefs

typedef boost::shared_ptr< const genfit::MaterialPropertiesSharedMaterialPropertiesPtr
 
typedef boost::shared_ptr< genfit::DetPlaneSharedPlanePtr
 Shared Pointer to a DetPlane.
 
typedef double M1x3[1 *3]
 
typedef double M1x4[1 *4]
 
typedef double M1x6[1 *6]
 
typedef double M1x7[1 *7]
 
typedef double M5x5[5 *5]
 
typedef double M6x6[6 *6]
 
typedef double M7x7[7 *7]
 
typedef double M8x7[8 *7]
 
typedef double M6x5[6 *5]
 
typedef double M7x5[7 *5]
 
typedef double M5x6[5 *6]
 
typedef double M5x7[5 *7]
 

Enumerations

enum  eFitterType { SimpleKalman , RefKalman , DafSimple , DafRef }
 
enum  eMultipleMeasurementHandling {
  weightedAverage , unweightedAverage , weightedClosestToReference , unweightedClosestToReference ,
  weightedClosestToPrediction , unweightedClosestToPrediction , weightedClosestToReferenceWire , unweightedClosestToReferenceWire ,
  weightedClosestToPredictionWire , unweightedClosestToPredictionWire
}
 
enum  StepLimitType {
  stp_noLimit = 0 , stp_fieldCurv , stp_momLoss , stp_sMax ,
  stp_sMaxArg , stp_boundary , stp_plane , ENUM_NR_ITEMS
}
 
enum  eMeasurementType {
  Pixel = 0 , Spacepoint , ProlateSpacepoint , StripU ,
  StripV , StripUV , Wire , WirePoint
}
 

Functions

AbsFitterInfonew_clone (const AbsFitterInfo &a)
 Needed for boost cloneability:
 
MeasuredStateOnPlane calcAverageState (const MeasuredStateOnPlane &forwardState, const MeasuredStateOnPlane &backwardState)
 Calculate weighted average between two MeasuredStateOnPlanes.
 
bool operator== (const DetPlane &lhs, const DetPlane &rhs)
 
bool operator!= (const DetPlane &lhs, const DetPlane &rhs)
 
bool operator== (const MaterialProperties &lhs, const MaterialProperties &rhs)
 
bool operator!= (const MaterialProperties &lhs, const MaterialProperties &rhs)
 
bool operator== (const TrackCand &lhs, const TrackCand &rhs)
 
bool operator== (const TrackCandHit &lhs, const TrackCandHit &rhs)
 
std::vector< rave::Track > GFTracksToTracks (const std::vector< genfit::Track * > &GFTracks, std::vector< genfit::MeasuredStateOnPlane * > *GFStates, std::map< int, genfit::trackAndState > &IdGFTrackStateMap, int startID=0)
 
rave::Track GFTrackToTrack (trackAndState, int id=-1, std::string tag="")
 
void setData (const rave::Track &orig, MeasuredStateOnPlane *state)
 
GFRaveVertexRaveToGFVertex (const rave::Vertex &, const std::map< int, genfit::trackAndState > &IdGFTrackStateMap)
 
void RaveToGFVertices (std::vector< GFRaveVertex * > *, const std::vector< rave::Vertex > &, const std::map< int, genfit::trackAndState > &IdGFTrackStateMap)
 
SharedPlanePtr PlaneToGFDetPlane (const ravesurf::Plane &rplane)
 
TVector3 Point3DToTVector3 (const rave::Point3D &)
 
TVector3 Vector3DToTVector3 (const rave::Vector3D &)
 
TMatrixDSym Covariance3DToTMatrixDSym (const rave::Covariance3D &)
 
TVectorD Vector6DToTVectorD (const rave::Vector6D &)
 
TMatrixDSym Covariance6DToTMatrixDSym (const rave::Covariance6D &)
 
rave::Point3D TVector3ToPoint3D (const TVector3 &)
 
rave::Covariance3D TMatrixDSymToCovariance3D (const TMatrixDSym &)
 
double MeanExcEnergy_get (int Z)
 
double MeanExcEnergy_get (TGeoMaterial *)
 

Variables

const int MeanExcEnergy_NELEMENTS = 93
 
const double MeanExcEnergy_vals [] = {1.e15, 19.2, 41.8, 40.0, 63.7, 76.0, 78., 82.0, 95.0, 115.0, 137.0, 149.0, 156.0, 166.0, 173.0, 173.0, 180.0, 174.0, 188.0, 190.0, 191.0, 216.0, 233.0, 245.0, 257.0, 272.0, 286.0, 297.0, 311.0, 322.0, 330.0, 334.0, 350.0, 347.0, 348.0, 343.0, 352.0, 363.0, 366.0, 379.0, 393.0, 417.0, 424.0, 428.0, 441.0, 449.0, 470.0, 470.0, 469.0, 488.0, 488.0, 487.0, 485.0, 491.0, 482.0, 488.0, 491.0, 501.0, 523.0, 535.0, 546.0, 560.0, 574.0, 580.0, 591.0, 614.0, 628.0, 650.0, 658.0, 674.0, 684.0, 694.0, 705.0, 718.0, 727.0, 736.0, 746.0, 757.0, 790.0, 790.0, 800.0, 810.0, 823.0, 823.0, 830.0, 825.0, 794.0, 827.0, 826.0, 841.0, 847.0, 878.0, 890.0}
 

Detailed Description

Matrix inversion tools.

Collection of converter functions.

Typedef Documentation

◆ M1x3

typedef double genfit::M1x3[1 *3]

Array Matrix typedefs. They are needed for SSE optimization: gcc can vectorize loops only if the array sizes are known.

Definition at line 33 of file RKTools.h.

◆ M1x4

typedef double genfit::M1x4[1 *4]

Definition at line 34 of file RKTools.h.

◆ M1x6

typedef double genfit::M1x6[1 *6]

Definition at line 35 of file RKTools.h.

◆ M1x7

typedef double genfit::M1x7[1 *7]

Definition at line 36 of file RKTools.h.

◆ M5x5

typedef double genfit::M5x5[5 *5]

Definition at line 37 of file RKTools.h.

◆ M5x6

typedef double genfit::M5x6[5 *6]

Definition at line 43 of file RKTools.h.

◆ M5x7

typedef double genfit::M5x7[5 *7]

Definition at line 44 of file RKTools.h.

◆ M6x5

typedef double genfit::M6x5[6 *5]

Definition at line 41 of file RKTools.h.

◆ M6x6

typedef double genfit::M6x6[6 *6]

Definition at line 38 of file RKTools.h.

◆ M7x5

typedef double genfit::M7x5[7 *5]

Definition at line 42 of file RKTools.h.

◆ M7x7

typedef double genfit::M7x7[7 *7]

Definition at line 39 of file RKTools.h.

◆ M8x7

typedef double genfit::M8x7[8 *7]

Definition at line 40 of file RKTools.h.

◆ SharedMaterialPropertiesPtr

Definition at line 38 of file SharedMaterialPropertiesPtr.h.

◆ SharedPlanePtr

typedef boost::shared_ptr< genfit::DetPlane > genfit::SharedPlanePtr

Shared Pointer to a DetPlane.

Ownership can be shared, e.g between multiple StateOnPlane objects. The DetPlane will automatically be deleted, if no owner remains.

Definition at line 43 of file SharedPlanePtr.h.

Enumeration Type Documentation

◆ eFitterType

Enumerator
SimpleKalman 
RefKalman 
DafSimple 
DafRef 

Definition at line 41 of file EventDisplay.h.

41 {
45 DafRef
46};
@ SimpleKalman

◆ eMeasurementType

Enumerator
Pixel 
Spacepoint 
ProlateSpacepoint 
StripU 
StripV 
StripUV 
Wire 
WirePoint 

Definition at line 42 of file MeasurementCreator.h.

◆ eMultipleMeasurementHandling

Enumerator
weightedAverage 

weighted average between measurements; used by DAF

unweightedAverage 

average between measurements, all weighted with 1

weightedClosestToReference 

closest to reference, weighted with its weight_

unweightedClosestToReference 

closest to reference, weighted with 1

weightedClosestToPrediction 

closest to prediction, weighted with its weight_

unweightedClosestToPrediction 

closest to prediction, weighted with 1

weightedClosestToReferenceWire 

if corresponding TrackPoint has one WireMeasurement, select closest to reference, weighted with its weight_. Otherwise use weightedAverage.

unweightedClosestToReferenceWire 

if corresponding TrackPoint has one WireMeasurement, select closest to reference, weighted with 1. Otherwise use unweightedAverage.

weightedClosestToPredictionWire 

if corresponding TrackPoint has one WireMeasurement, select closest to prediction, weighted with its weight_. Otherwise use weightedAverage.

unweightedClosestToPredictionWire 

if corresponding TrackPoint has one WireMeasurement, select closest to prediction, weighted with 1. Otherwise use unweightedAverage. Recommended for KalmanFitter to 'resolve' l/r ambiguities

Definition at line 35 of file AbsKalmanFitter.h.

◆ StepLimitType

Enumerator
stp_noLimit 
stp_fieldCurv 
stp_momLoss 
stp_sMax 
stp_sMaxArg 
stp_boundary 
stp_plane 
ENUM_NR_ITEMS 

Definition at line 33 of file StepLimits.h.

33 {
34 // soft limits (only rough estimation, can go beyond safely)
35 stp_noLimit = 0, // only for internal use
36
37 // medium limits (can go a bit further if e.g. plane or boundary will be reached)
38 stp_fieldCurv, // stepsize limited by curvature and magnetic field inhomogenities
39 stp_momLoss, // stepsize limited by stepper because maximum momLoss is reached
40 stp_sMax, // stepsize limited by SMax defined in #estimateStep()
41
42 // hard limits (must stop there at any case!)
43 stp_sMaxArg, // stepsize limited by argument maxStepArg passed to #estimateStep()
44 stp_boundary, // stepsize limited by stepper because material boundary is encountered
45 stp_plane, // stepsize limited because destination plane is reached
46
47 ENUM_NR_ITEMS // only for internal use
48};
@ stp_noLimit
Definition StepLimits.h:35
@ stp_fieldCurv
Definition StepLimits.h:38
@ stp_boundary
Definition StepLimits.h:44
@ stp_sMax
Definition StepLimits.h:40
@ ENUM_NR_ITEMS
Definition StepLimits.h:47
@ stp_sMaxArg
Definition StepLimits.h:43
@ stp_momLoss
Definition StepLimits.h:39
@ stp_plane
Definition StepLimits.h:45

Function Documentation

◆ calcAverageState()

MeasuredStateOnPlane genfit::calcAverageState ( const MeasuredStateOnPlane forwardState,
const MeasuredStateOnPlane backwardState 
)

Calculate weighted average between two MeasuredStateOnPlanes.

Definition at line 65 of file MeasuredStateOnPlane.cc.

65 {
66 // check if both states are defined in the same plane
67 if (forwardState.getPlane() != backwardState.getPlane()) {
68 Exception e("KalmanFitterInfo::calcAverageState: forwardState and backwardState are not defined in the same plane.", __LINE__,__FILE__);
69 throw e;
70 }
71
72 // This code is called a lot, so some effort has gone into reducing
73 // the number of temporary objects being constructed.
74
75#if 0
76 // For ease of understanding, here's a version of the code that is a
77 // few percent slower, depending on the exact use-case, but which
78 // makes the math more explicit:
79 TMatrixDSym fCovInv, bCovInv, smoothed_cov;
80 tools::invertMatrix(forwardState.getCov(), fCovInv);
81 tools::invertMatrix(backwardState.getCov(), bCovInv);
82
83 tools::invertMatrix(fCovInv + bCovInv, smoothed_cov); // one temporary TMatrixDSym
84
85 MeasuredStateOnPlane retVal(forwardState);
86 retVal.setState(smoothed_cov*(fCovInv*forwardState.getState() + bCovInv*backwardState.getState())); // four temporary TVectorD's
87 retVal.setCov(smoothed_cov);
88 return retVal;
89#endif
90
91 static TMatrixDSym fCovInv, bCovInv; // Static to avoid re-constructing for every call
92 tools::invertMatrix(forwardState.getCov(), fCovInv);
93 tools::invertMatrix(backwardState.getCov(), bCovInv);
94
95 // Using a StateOnPlane here turned out at least as fast as
96 // constructing a MeasuredStateOnPlane here, and then resetting its
97 // covariance matrix below, even though it means another copy in the
98 // return statement.
99 StateOnPlane sop(forwardState); // copies auxInfo, plane, rep in the process
100 // Using 'static' + subsequent assignment is measurably slower.
101 // Surprisingly, using only TVectorD
102 // sop(forwardState.getState()) with according
103 // changes below measured slower.
104
105 sop.getState() *= fCovInv;
106 fCovInv += bCovInv;
107 tools::invertMatrix(fCovInv); // This is now the covariance of the average.
108 sop.getState() += bCovInv*backwardState.getState(); // one temporary TVectorD
109 sop.getState() *= fCovInv;
110
111 return MeasuredStateOnPlane(sop, fCovInv);
112}
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition Exception.h:48
const TMatrixDSym & getCov() const
const TVectorD & getState() const
const SharedPlanePtr & getPlane() const

◆ Covariance3DToTMatrixDSym()

TMatrixDSym genfit::Covariance3DToTMatrixDSym ( const rave::Covariance3D &  ravecov)

Definition at line 243 of file GFRaveConverters.cc.

243 {
244 TMatrixDSym cov(3);
245
246 cov(0,0) = ravecov.dxx();
247 cov(0,1) = ravecov.dxy();
248 cov(0,2) = ravecov.dxz();
249
250 cov(1,0) = ravecov.dxy();
251 cov(1,1) = ravecov.dyy();
252 cov(1,2) = ravecov.dyz();
253
254 cov(2,0) = ravecov.dxz();
255 cov(2,1) = ravecov.dyz();
256 cov(2,2) = ravecov.dzz();
257
258 return cov;
259}

◆ Covariance6DToTMatrixDSym()

TMatrixDSym genfit::Covariance6DToTMatrixDSym ( const rave::Covariance6D &  ravecov)

Definition at line 279 of file GFRaveConverters.cc.

279 {
280 TMatrixDSym cov(6);
281
282 cov(0,0) = ravecov.dxx();
283 cov(0,1) = ravecov.dxy();
284 cov(0,2) = ravecov.dxz();
285 cov(0,3) = ravecov.dxpx();
286 cov(0,4) = ravecov.dxpy();
287 cov(0,5) = ravecov.dxpz();
288
289 cov(1,0) = ravecov.dxy();
290 cov(1,1) = ravecov.dyy();
291 cov(1,2) = ravecov.dyz();
292 cov(1,3) = ravecov.dypx();
293 cov(1,4) = ravecov.dypy();
294 cov(1,5) = ravecov.dypz();
295
296 cov(2,0) = ravecov.dxz();
297 cov(2,1) = ravecov.dyz();
298 cov(2,2) = ravecov.dzz();
299 cov(2,3) = ravecov.dzpx();
300 cov(2,4) = ravecov.dzpy();
301 cov(2,5) = ravecov.dzpz();
302
303 cov(3,0) = ravecov.dxpx();
304 cov(3,1) = ravecov.dypx();
305 cov(3,2) = ravecov.dzpx();
306 cov(3,3) = ravecov.dpxpx();
307 cov(3,4) = ravecov.dpxpy();
308 cov(3,5) = ravecov.dpxpz();
309
310 cov(4,0) = ravecov.dxpy();
311 cov(4,1) = ravecov.dypy();
312 cov(4,2) = ravecov.dzpy();
313 cov(4,3) = ravecov.dpxpy();
314 cov(4,4) = ravecov.dpypy();
315 cov(4,5) = ravecov.dpypz();
316
317 cov(5,0) = ravecov.dxpz();
318 cov(5,1) = ravecov.dypz();
319 cov(5,2) = ravecov.dzpz();
320 cov(5,3) = ravecov.dpxpz();
321 cov(5,4) = ravecov.dpypz();
322 cov(5,5) = ravecov.dpzpz();
323
324 return cov;
325}

◆ GFTracksToTracks()

std::vector< rave::Track > genfit::GFTracksToTracks ( const std::vector< genfit::Track * > &  GFTracks,
std::vector< genfit::MeasuredStateOnPlane * > *  GFStates,
std::map< int, genfit::trackAndState > &  IdGFTrackStateMap,
int  startID = 0 
)

Convert a vector of genfit::Tracks to rave::Tracks also builds a map of unique ids to genfit::Tracks; These ids are stored in the rave::tracks. They are counted from startID. The map has to be passed to the GFRavePropagator, so that it can access the trackreps of the genfit::Tracks corresponding to the rave::tracks. If a vector of MeasuredStateOnPlane is provided, they will be used (instead of the tracks fitted states) to calculate the rave::Track parameters. Ownership over MeasuredStateOnPlane will be taken.

Definition at line 36 of file GFRaveConverters.cc.

39 {
40
41 unsigned int ntracks(GFTracks.size());
42
43 if (GFStates != NULL)
44 if (GFTracks.size() != GFStates->size()) {
45 Exception exc("GFTracksToTracks ==> GFStates has not the same size as GFTracks!",__LINE__,__FILE__);
46 throw exc;
47 }
48
49 std::vector < rave::Track > ravetracks;
50 ravetracks.reserve(ntracks);
51
52 for (unsigned int i=0; i<ntracks; ++i){
53
54 if (GFTracks[i] == NULL) {
55 Exception exc("GFTracksToTracks ==> genfit::Track is NULL",__LINE__,__FILE__);
56 throw exc;
57 }
58
59 // only convert successfully fitted tracks!
60 if (!GFTracks[i]->getFitStatus(GFTracks[i]->getCardinalRep())->isFitConverged()) continue;
61
62 if (IdGFTrackStateMap.count(startID) > 0){
63 Exception exc("GFTracksToTracks ==> IdGFTrackStateMap has already an entry for this id",__LINE__,__FILE__);
64 throw exc;
65 }
66 IdGFTrackStateMap[startID].track_ = GFTracks[i];
67 if (GFStates == NULL)
68 IdGFTrackStateMap[startID].state_ = new MeasuredStateOnPlane(GFTracks[i]->getFittedState()); // here clones are made so that the state of the original GFTracks and their TrackReps will not be altered by the vertexing process
69 else
70 IdGFTrackStateMap[startID].state_ = (*GFStates)[i];
71
72 ravetracks.push_back(GFTrackToTrack(IdGFTrackStateMap[startID], startID) );
73
74 ++startID;
75 }
76
77 //std::cout << "IdGFTrackStateMap size " << IdGFTrackStateMap.size() << std::endl;
78 return ravetracks;
79}
int i
Definition ShipAna.py:86
rave::Track GFTrackToTrack(trackAndState, int id=-1, std::string tag="")

◆ GFTrackToTrack()

rave::Track genfit::GFTrackToTrack ( trackAndState  trackAndState,
int  id = -1,
std::string  tag = "" 
)

Definition at line 83 of file GFRaveConverters.cc.

83 {
84
85 if (trackAndState.track_ == NULL) {
86 Exception exc("GFTrackToTrack ==> originaltrack is NULL",__LINE__,__FILE__);
87 throw exc;
88 }
89
90 if (! trackAndState.track_->getFitStatus()->isFitConverged()) {
91 Exception exc("GFTrackToTrack ==> Trackfit is not converged",__LINE__,__FILE__);
92 throw exc;
93 }
94
95 TVector3 pos, mom;
96 TMatrixDSym cov;
97
98 trackAndState.track_->getFittedState().getPosMomCov(pos, mom, cov);
99
100 // state
101 rave::Vector6D ravestate(pos.X(), pos.Y(), pos.Z(),
102 mom.X(), mom.Y(), mom.Z());
103
104 // covariance
105 rave::Covariance6D ravecov(cov(0,0), cov(1,0), cov(2,0),
106 cov(1,1), cov(2,1), cov(2,2),
107 cov(3,0), cov(4,0), cov(5,0),
108 cov(3,1), cov(4,1), cov(5,1),
109 cov(3,2), cov(4,2), cov(5,2),
110 cov(3,3), cov(4,3), cov(5,3),
111 cov(4,4), cov(5,4), cov(5,5));
112
113 //std::cerr<<"create rave track with id " << id << std::endl;
114 //std::cerr<<" pos: "; Point3DToTVector3(ravestate.position()).Print();
115 //std::cerr<<" mom: "; Vector3DToTVector3(ravestate.momentum()).Print();
116
117 rave::Track ret(id, ravestate, ravecov,
118 trackAndState.track_->getFitStatus()->getCharge(),
119 trackAndState.track_->getFitStatus()->getChi2(),
120 trackAndState.track_->getFitStatus()->getNdf(),
121 static_cast<void*>(const_cast<Track*>(trackAndState.track_)), tag);
122
123 //std::cout << "ret.originalObject() " << ret.originalObject() << "\n";
124 //std::cout << "ret.id() " << ret.id() << "\n";
125
126 return ret;
127}
double getCharge() const
Get the fitted charge.
Definition FitStatus.h:72
double getNdf() const
Get the degrees of freedom of the fit.
Definition FitStatus.h:76
bool isFitConverged(bool inAllPoints=true) const
Did the fit converge (in all Points or only partially)?
Definition FitStatus.h:61
double getChi2() const
Get chi^2 of the fit.
Definition FitStatus.h:74
void getPosMomCov(TVector3 &pos, TVector3 &mom, TMatrixDSym &cov) const
const MeasuredStateOnPlane & getFittedState(int id=0, const AbsTrackRep *rep=NULL, bool biased=true) const
Shortcut to get FittedStates.
Definition Track.cc:231
FitStatus * getFitStatus(const AbsTrackRep *rep=NULL) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.
Definition Track.h:149
Simple struct containing a Track pointer and a MeasuredStateOnPlane. Used in GFRave.

◆ MeanExcEnergy_get() [1/2]

double genfit::MeanExcEnergy_get ( int  Z)

Definition at line 223 of file TGeoMaterialInterface.cc.

223 {
224 assert(Z >= 0 && Z < MeanExcEnergy_NELEMENTS);
225 return MeanExcEnergy_vals[Z];
226}
const double MeanExcEnergy_vals[]

◆ MeanExcEnergy_get() [2/2]

double genfit::MeanExcEnergy_get ( TGeoMaterial *  mat)

Definition at line 230 of file TGeoMaterialInterface.cc.

230 {
231 if (mat->IsMixture()) {
232 double logMEE = 0.;
233 double denom = 0.;
234 TGeoMixture* mix = (TGeoMixture*)mat;
235 for (int i = 0; i < mix->GetNelements(); ++i) {
236 int index = int(floor((mix->GetZmixt())[i]));
237 logMEE += 1. / (mix->GetAmixt())[i] * (mix->GetWmixt())[i] * (mix->GetZmixt())[i] * log(MeanExcEnergy_get(index));
238 denom += (mix->GetWmixt())[i] * (mix->GetZmixt())[i] * 1. / (mix->GetAmixt())[i];
239 }
240 logMEE /= denom;
241 return exp(logMEE);
242 } else { // not a mixture
243 int index = int(floor(mat->GetZ()));
244 return MeanExcEnergy_get(index);
245 }
246}
double MeanExcEnergy_get(int Z)

◆ new_clone()

AbsFitterInfo * genfit::new_clone ( const AbsFitterInfo a)
inline

Needed for boost cloneability:

Definition at line 107 of file AbsFitterInfo.h.

108{
109 return a.clone();
110}

◆ operator!=() [1/2]

bool genfit::operator!= ( const DetPlane lhs,
const DetPlane rhs 
)

Definition at line 263 of file DetPlane.cc.

263 {
264 return !(lhs==rhs);
265}

◆ operator!=() [2/2]

bool genfit::operator!= ( const MaterialProperties lhs,
const MaterialProperties rhs 
)

Definition at line 39 of file MaterialProperties.cc.

39 {
40 return !(lhs==rhs);
41}

◆ operator==() [1/4]

bool genfit::operator== ( const DetPlane lhs,
const DetPlane rhs 
)

Definition at line 241 of file DetPlane.cc.

241 {
242 if (&lhs == &rhs)
243 return true;
244 static const double detplaneEpsilon = 1.E-5;
245 if(
246 fabs( (lhs.o_.X()-rhs.o_.X()) ) > detplaneEpsilon ||
247 fabs( (lhs.o_.Y()-rhs.o_.Y()) ) > detplaneEpsilon ||
248 fabs( (lhs.o_.Z()-rhs.o_.Z()) ) > detplaneEpsilon
249 ) return false;
250 else if(
251 fabs( (lhs.u_.X()-rhs.u_.X()) ) > detplaneEpsilon ||
252 fabs( (lhs.u_.Y()-rhs.u_.Y()) ) > detplaneEpsilon ||
253 fabs( (lhs.u_.Z()-rhs.u_.Z()) ) > detplaneEpsilon
254 ) return false;
255 else if(
256 fabs( (lhs.v_.X()-rhs.v_.X()) ) > detplaneEpsilon ||
257 fabs( (lhs.v_.Y()-rhs.v_.Y()) ) > detplaneEpsilon ||
258 fabs( (lhs.v_.Z()-rhs.v_.Z()) ) > detplaneEpsilon
259 ) return false;
260 return true;
261}

◆ operator==() [2/4]

bool genfit::operator== ( const MaterialProperties lhs,
const MaterialProperties rhs 
)

Definition at line 26 of file MaterialProperties.cc.

26 {
27 if (&lhs == &rhs)
28 return true;
29 if (lhs.density_ != rhs.density_ ||
30 lhs.Z_ != rhs.Z_ ||
31 lhs.A_ != rhs.A_ ||
33 lhs.mEE_ != rhs.mEE_)
34 return false;
35
36 return true;
37}
double radiationLength_
radiation length X0
double density_
density of material
double mEE_
mean excitation energy [eV]
double Z_
Atomic number Z of material.
double A_
Mass number A of material.

◆ operator==() [3/4]

bool genfit::operator== ( const TrackCand lhs,
const TrackCand rhs 
)

Definition at line 188 of file TrackCand.cc.

188 {
189 if(lhs.getNHits() != rhs.getNHits()) return false;
190 for (unsigned int i = 0; i < lhs.getNHits(); ++i){
191 if (lhs.getHit(i) != rhs.getHit(i)) return false;
192 }
193 return true;
194}
unsigned int getNHits() const
Definition TrackCand.h:103
TrackCandHit * getHit(int i) const
Definition TrackCand.cc:85

◆ operator==() [4/4]

bool genfit::operator== ( const TrackCandHit lhs,
const TrackCandHit rhs 
)

Definition at line 47 of file TrackCandHit.cc.

47 {
48 if(lhs.detId_ == rhs.detId_ &&
49 lhs.hitId_ == rhs.hitId_ &&
50 lhs.planeId_ == rhs.planeId_)
51 return true;
52 return false;
53}

◆ PlaneToGFDetPlane()

SharedPlanePtr genfit::PlaneToGFDetPlane ( const ravesurf::Plane &  rplane)

Definition at line 225 of file GFRaveConverters.cc.

225 {
226 return SharedPlanePtr(new DetPlane(Point3DToTVector3(rplane.position()),
227 Vector3DToTVector3(rplane.normalVector()) ));
228}
Detector plane.
Definition DetPlane.h:61
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
TVector3 Vector3DToTVector3(const rave::Vector3D &)
TVector3 Point3DToTVector3(const rave::Point3D &)

◆ Point3DToTVector3()

TVector3 genfit::Point3DToTVector3 ( const rave::Point3D &  v)

Definition at line 232 of file GFRaveConverters.cc.

232 {
233 return TVector3(v.x(), v.y(), v.z());
234}

◆ RaveToGFVertex()

GFRaveVertex * genfit::RaveToGFVertex ( const rave::Vertex &  raveVertex,
const std::map< int, genfit::trackAndState > &  IdGFTrackStateMap 
)

Definition at line 141 of file GFRaveConverters.cc.

142 {
143
144 if (!(raveVertex.isValid())) {
145 Exception exc("RaveToGFVertex ==> rave Vertex is not valid!",__LINE__,__FILE__);
146 throw exc;
147 }
148
149 std::vector < std::pair < float, rave::Track > > raveWeightedTracks(raveVertex.weightedTracks());
150 std::vector < std::pair < float, rave::Track > > raveSmoothedTracks(raveVertex.weightedRefittedTracks());
151
152 int id;
153 unsigned int nTrks(raveWeightedTracks.size());
154
155 // check if rave vertex has refitted tracks
156 bool smoothing(true);
157 if (! (raveVertex.hasRefittedTracks()) ) {
158 smoothing = false;
159 }
160
161 // check numbers of tracks and smoothed tracks
162 if (smoothing && nTrks != raveSmoothedTracks.size()){
163 Exception exc("RaveToGFVertex ==> number of smoothed tracks != number of tracks",__LINE__,__FILE__);
164 throw exc;
165 }
166
167 // (smoothed) track parameters
168 std::vector < GFRaveTrackParameters* > trackParameters;
169 trackParameters.reserve(nTrks);
170
171 // convert tracks
172 for (unsigned int i=0; i<nTrks; ++i){
173 id = raveWeightedTracks[i].second.id();
174
175 if (IdGFTrackStateMap.count(id) == 0){
176 Exception exc("RaveToGFVertex ==> rave track id is not present in IdGFTrackStateMap",__LINE__,__FILE__);
177 throw exc;
178 }
179
180 GFRaveTrackParameters* trackparams;
181
182 if(smoothing) {
183 // convert smoothed track parameters
184 trackparams = new GFRaveTrackParameters(IdGFTrackStateMap.at(id).track_, //track
185 IdGFTrackStateMap.at(id).state_, //state
186 raveWeightedTracks[i].first, //weight
187 Vector6DToTVectorD(raveSmoothedTracks[i].second.state()), //smoothed state
188 Covariance6DToTMatrixDSym(raveSmoothedTracks[i].second.error()), //smoothed cov
189 true);
190 }
191 else {
192 // convert track parameters, no smoothed tracks available
193 trackparams = new GFRaveTrackParameters(IdGFTrackStateMap.at(id).track_, //track
194 IdGFTrackStateMap.at(id).state_, //state
195 raveWeightedTracks[i].first, //weight
196 Vector6DToTVectorD(raveWeightedTracks[i].second.state()), //state
197 Covariance6DToTMatrixDSym(raveWeightedTracks[i].second.error()), //cov
198 false);
199 }
200 trackParameters.push_back(trackparams);
201 }
202
203 return new GFRaveVertex(Point3DToTVector3(raveVertex.position()),
204 Covariance3DToTMatrixDSym(raveVertex.error()),
205 trackParameters,
206 raveVertex.ndf(), raveVertex.chiSquared(), raveVertex.id());
207}
TVectorD Vector6DToTVectorD(const rave::Vector6D &)
TMatrixDSym Covariance6DToTMatrixDSym(const rave::Covariance6D &)
TMatrixDSym Covariance3DToTMatrixDSym(const rave::Covariance3D &)
int second
Definition hepunit.py:85

◆ RaveToGFVertices()

void genfit::RaveToGFVertices ( std::vector< GFRaveVertex * > *  GFVertices,
const std::vector< rave::Vertex > &  raveVertices,
const std::map< int, genfit::trackAndState > &  IdGFTrackStateMap 
)

Definition at line 210 of file GFRaveConverters.cc.

212 {
213
214 unsigned int nVert(raveVertices.size());
215
216 GFVertices->reserve(nVert);
217
218 for (unsigned int i=0; i<nVert; ++i){
219 GFVertices->push_back(RaveToGFVertex(raveVertices[i], IdGFTrackStateMap));
220 }
221}
GFRaveVertex * RaveToGFVertex(const rave::Vertex &, const std::map< int, genfit::trackAndState > &IdGFTrackStateMap)

◆ setData()

void genfit::setData ( const rave::Track &  orig,
MeasuredStateOnPlane state 
)

set state and cov of a MeasuredStateOnPlane according to rave track

Definition at line 131 of file GFRaveConverters.cc.

131 {
132
133 state->setPosMomCov(TVector3(orig.state().x(), orig.state().y(), orig.state().z()),
134 TVector3(orig.state().px(), orig.state().py(), orig.state().pz()),
135 Covariance6DToTMatrixDSym(orig.error()));
136
137}
void setPosMomCov(const TVector3 &pos, const TVector3 &mom, const TMatrixDSym &cov6x6)

◆ TMatrixDSymToCovariance3D()

rave::Covariance3D genfit::TMatrixDSymToCovariance3D ( const TMatrixDSym &  matrix)

Definition at line 335 of file GFRaveConverters.cc.

335 {
336 if (matrix.GetNrows()!=3) {
337 Exception exc("TMatrixDSymToCovariance3D ==> TMatrixDSym is not 3x3!",__LINE__,__FILE__);
338 throw exc;
339 }
340
341 return rave::Covariance3D(matrix(0,0), matrix(0,1), matrix(0,2),
342 matrix(1,1), matrix(1,2), matrix(2,2));
343
344}

◆ TVector3ToPoint3D()

rave::Point3D genfit::TVector3ToPoint3D ( const TVector3 &  vec)

Definition at line 329 of file GFRaveConverters.cc.

329 {
330 return rave::Point3D(vec.X(), vec.Y(), vec.Z());
331}

◆ Vector3DToTVector3()

TVector3 genfit::Vector3DToTVector3 ( const rave::Vector3D &  v)

Definition at line 237 of file GFRaveConverters.cc.

237 {
238 return TVector3(v.x(), v.y(), v.z());
239}

◆ Vector6DToTVectorD()

TVectorD genfit::Vector6DToTVectorD ( const rave::Vector6D &  ravevec)

Definition at line 263 of file GFRaveConverters.cc.

263 {
264 TVectorD vec(6);
265
266 vec[0] = ravevec.x();
267 vec[1] = ravevec.y();
268 vec[2] = ravevec.z();
269
270 vec[3] = ravevec.px();
271 vec[4] = ravevec.py();
272 vec[5] = ravevec.pz();
273
274 return vec;
275}

Variable Documentation

◆ MeanExcEnergy_NELEMENTS

const int genfit::MeanExcEnergy_NELEMENTS = 93

Definition at line 218 of file TGeoMaterialInterface.cc.

◆ MeanExcEnergy_vals

const double genfit::MeanExcEnergy_vals[] = {1.e15, 19.2, 41.8, 40.0, 63.7, 76.0, 78., 82.0, 95.0, 115.0, 137.0, 149.0, 156.0, 166.0, 173.0, 173.0, 180.0, 174.0, 188.0, 190.0, 191.0, 216.0, 233.0, 245.0, 257.0, 272.0, 286.0, 297.0, 311.0, 322.0, 330.0, 334.0, 350.0, 347.0, 348.0, 343.0, 352.0, 363.0, 366.0, 379.0, 393.0, 417.0, 424.0, 428.0, 441.0, 449.0, 470.0, 470.0, 469.0, 488.0, 488.0, 487.0, 485.0, 491.0, 482.0, 488.0, 491.0, 501.0, 523.0, 535.0, 546.0, 560.0, 574.0, 580.0, 591.0, 614.0, 628.0, 650.0, 658.0, 674.0, 684.0, 694.0, 705.0, 718.0, 727.0, 736.0, 746.0, 757.0, 790.0, 790.0, 800.0, 810.0, 823.0, 823.0, 830.0, 825.0, 794.0, 827.0, 826.0, 841.0, 847.0, 878.0, 890.0}

Definition at line 219 of file TGeoMaterialInterface.cc.

219{1.e15, 19.2, 41.8, 40.0, 63.7, 76.0, 78., 82.0, 95.0, 115.0, 137.0, 149.0, 156.0, 166.0, 173.0, 173.0, 180.0, 174.0, 188.0, 190.0, 191.0, 216.0, 233.0, 245.0, 257.0, 272.0, 286.0, 297.0, 311.0, 322.0, 330.0, 334.0, 350.0, 347.0, 348.0, 343.0, 352.0, 363.0, 366.0, 379.0, 393.0, 417.0, 424.0, 428.0, 441.0, 449.0, 470.0, 470.0, 469.0, 488.0, 488.0, 487.0, 485.0, 491.0, 482.0, 488.0, 491.0, 501.0, 523.0, 535.0, 546.0, 560.0, 574.0, 580.0, 591.0, 614.0, 628.0, 650.0, 658.0, 674.0, 684.0, 694.0, 705.0, 718.0, 727.0, 736.0, 746.0, 757.0, 790.0, 790.0, 800.0, 810.0, 823.0, 823.0, 830.0, 825.0, 794.0, 827.0, 826.0, 841.0, 847.0, 878.0, 890.0};