-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31314 from JanFSchulte/VHIntegrationV2
Integrating VectorHits reconstruction for the Phase2 OT - reprise
- Loading branch information
Showing
70 changed files
with
4,804 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
# This modifier is for activating Vector Hits reconstruction in the Phase II OT | ||
|
||
vectorHits = cms.Modifier() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
#ifndef DataFormats_TrackerRecHit2D_VectorHit_h | ||
#define DataFormats_TrackerRecHit2D_VectorHit_h | ||
|
||
/** \class VectorHit | ||
* | ||
* 4-parameter RecHits for Phase2 Tracker (x,y, dx/dz, dy/dz) | ||
* | ||
* $Date: 2015/03/30 $ | ||
* \author Erica Brondolin | ||
* | ||
*/ | ||
|
||
#include "DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/VectorHit2D.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/OmniClusterRef.h" | ||
|
||
#include "DataFormats/Common/interface/DetSetVector.h" | ||
#include "DataFormats/Common/interface/DetSetVectorNew.h" | ||
|
||
#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" | ||
#include "DataFormats/GeometryVector/interface/LocalVector.h" | ||
#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h" | ||
|
||
#include "DataFormats/TrackingRecHit/interface/KfComponentsHolder.h" | ||
|
||
#include "DataFormats/TrackerRecHit2D/interface/TkCloner.h" | ||
|
||
class VectorHit final : public BaseTrackerRecHit { | ||
public: | ||
typedef OmniClusterRef::Phase2Cluster1DRef ClusterRef; | ||
|
||
VectorHit() : thePosition(), theDirection(), theCovMatrix() { setType(bad); } | ||
|
||
VectorHit(const GeomDet& idet, | ||
const LocalPoint& posInner, | ||
const LocalVector& dir, | ||
const AlgebraicSymMatrix44& covMatrix, | ||
const float chi2, | ||
OmniClusterRef const& lower, | ||
OmniClusterRef const& upper, | ||
const float curvature, | ||
const float curvatureError, | ||
const float phi); | ||
|
||
VectorHit(const GeomDet& idet, | ||
const VectorHit2D& vh2Dzx, | ||
const VectorHit2D& vh2Dzy, | ||
OmniClusterRef const& lower, | ||
OmniClusterRef const& upper, | ||
const float curvature, | ||
const float curvatureError, | ||
const float phi); | ||
|
||
~VectorHit() override = default; | ||
|
||
VectorHit* clone() const override { return new VectorHit(*this); } | ||
RecHitPointer cloneSH() const override { return std::make_shared<VectorHit>(*this); } | ||
|
||
bool sharesInput(const TrackingRecHit* other, SharedInputType what) const override; | ||
bool sharesClusters(VectorHit const& other, SharedInputType what) const; | ||
|
||
// Parameters of the segment, for the track fit | ||
// For a 4D segment: (dx/dz,dy/dz,x,y) | ||
bool hasPositionAndError() const override { | ||
//if det is present pos&err are available as well. | ||
//if det() is not present (null) the hit has been read from file and not updated | ||
return det(); | ||
}; | ||
|
||
void getKfComponents(KfComponentsHolder& holder) const override { getKfComponents4D(holder); } | ||
void getKfComponents4D(KfComponentsHolder& holder) const; | ||
|
||
// returning methods | ||
LocalPoint localPosition() const override { return thePosition; } | ||
virtual LocalVector localDirection() const { return theDirection; } | ||
const AlgebraicSymMatrix44& covMatrix() const; | ||
LocalError localPositionError() const override; | ||
LocalError localDirectionError() const; | ||
Global3DVector globalDirectionVH() const; | ||
|
||
float chi2() const { return theChi2; } | ||
int dimension() const override { return theDimension; } | ||
float curvature() const { return theCurvature; } | ||
float curvatureError() const { return theCurvatureError; } | ||
float phi() const { return thePhi; } | ||
|
||
float transverseMomentum(float magField) const; | ||
float momentum(float magField) const; | ||
|
||
/// "lower" is logical, not geometrically lower; in pixel-strip modules the "lower" is always a pixel | ||
ClusterRef lowerCluster() const { return theLowerCluster.cluster_phase2OT(); } | ||
ClusterRef upperCluster() const { return theUpperCluster.cluster_phase2OT(); } | ||
OmniClusterRef const lowerClusterRef() const { return theLowerCluster; } | ||
OmniClusterRef const upperClusterRef() const { return theUpperCluster; } | ||
|
||
//FIXME::to update with a proper CPE maybe... | ||
Global3DPoint lowerGlobalPos() const; | ||
Global3DPoint upperGlobalPos() const; | ||
static Global3DPoint phase2clusterGlobalPos(const PixelGeomDetUnit* geomDet, ClusterRef cluster); | ||
GlobalError lowerGlobalPosErr() const; | ||
GlobalError upperGlobalPosErr() const; | ||
static GlobalError phase2clusterGlobalPosErr(const PixelGeomDetUnit* geomDet); | ||
|
||
bool isPhase2() const override { return true; } | ||
|
||
//FIXME: I have always two clusters in a VH | ||
OmniClusterRef const& firstClusterRef() const override { return theLowerCluster; } | ||
ClusterRef cluster() const { return theLowerCluster.cluster_phase2OT(); } | ||
|
||
//This method returns the direction of the segment/stub in global coordinates | ||
Global3DVector globalDirection() const; | ||
float theta() const; | ||
|
||
// Access to component RecHits (if any) | ||
std::vector<const TrackingRecHit*> recHits() const override; | ||
std::vector<TrackingRecHit*> recHits() override; | ||
|
||
private: | ||
// double dispatch | ||
VectorHit* clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override { | ||
return cloner(*this, tsos).release(); | ||
} | ||
RecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override { | ||
return cloner.makeShared(*this, tsos); | ||
} | ||
|
||
LocalPoint thePosition; | ||
LocalVector theDirection; | ||
|
||
// the covariance matrix, has the following meaning | ||
// mat[0][0]=var(dx/dz) | ||
// mat[1][1]=var(dy/dz) | ||
// mat[2][2]=var(x) | ||
// mat[3][3]=var(y) | ||
// mat[0][2]=cov(dx/dz,x) | ||
// mat[1][3]=cov(dy/dz,y) | ||
AlgebraicSymMatrix44 theCovMatrix; | ||
float theChi2; | ||
static constexpr int theDimension = 4; | ||
OmniClusterRef theLowerCluster; | ||
OmniClusterRef theUpperCluster; | ||
float theCurvature; | ||
float theCurvatureError; | ||
float thePhi; | ||
}; | ||
|
||
inline bool operator<(const VectorHit& one, const VectorHit& other) { return (one.chi2() < other.chi2()); } | ||
|
||
std::ostream& operator<<(std::ostream& os, const VectorHit& vh); | ||
|
||
typedef edmNew::DetSetVector<VectorHit> VectorHitCollection; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef DataFormats_TrackerRecHit2D_VectorHit2D_h | ||
#define DataFormats_TrackerRecHit2D_VectorHit2D_h | ||
|
||
#include "DataFormats/GeometryVector/interface/LocalVector.h" | ||
#include "DataFormats/GeometryVector/interface/LocalPoint.h" | ||
#include "DataFormats/CLHEP/interface/AlgebraicObjects.h" | ||
#include "DataFormats/GeometrySurface/interface/LocalError.h" | ||
|
||
//Stores geometric information about VectorHits, their convariance matrix and chi2 of the compatability of the two hits | ||
|
||
class VectorHit2D { | ||
public: | ||
VectorHit2D() : thePosition(), theDirection(), theCovMatrix(), theChi2() {} | ||
VectorHit2D(const LocalPoint& pos, const LocalVector& dir, const AlgebraicSymMatrix22& covMatrix, const double& chi2) | ||
: thePosition(pos), | ||
theDirection(dir), | ||
theCovMatrix(covMatrix), | ||
theLocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]), | ||
theChi2(chi2) {} | ||
|
||
const LocalPoint& localPosition() const { return thePosition; } | ||
const LocalVector& localDirection() const { return theDirection; } | ||
const LocalError& localDirectionError() const { return theLocalError; } | ||
const AlgebraicSymMatrix22& covMatrix() const { return theCovMatrix; } | ||
float chi2() const { return theChi2; } | ||
int dimension() const { return theDimension; } | ||
|
||
private: | ||
LocalPoint thePosition; | ||
LocalVector theDirection; | ||
AlgebraicSymMatrix22 theCovMatrix; | ||
LocalError theLocalError; | ||
float theChi2; | ||
static constexpr int theDimension = 2; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.