-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrating VectorHits reconstruction for the Phase2 OT - reprise #31314
Changes from 114 commits
1d33be2
9643a44
3bc0dde
09136ad
e0a73fd
3e0523b
00ad9bb
e652383
5ad296d
05858c2
0ffda00
7c1b911
872a25c
ac8f3be
35bc979
672156a
2dd7bf8
d5c6cb4
428127c
236113f
ee3a194
c9eace1
8bdb8a4
9e38c4c
4391753
7b018f7
cb8050b
4e69b00
728f0d0
8b43243
472b65a
7725ff0
ac77617
5f6110a
b775266
142acec
ce1a3ea
5903788
efcebde
727cb46
17bbbd6
d06cd10
9e1ca77
6fa2229
2536365
1009a20
b17261d
01114c0
2cdd767
ccf9e94
33bbeff
758d273
754d08c
403ac04
7c64d65
424df27
9109e2e
0aba3e5
90cf48a
6b9b4f2
61599bc
18a03b3
8bf7d15
45ec1f2
17a2e02
f149ea2
ccc74b6
999d80b
92f2c7e
68ea0ce
ba5e5d4
2d15513
66e765d
c3357eb
e9b6828
580200d
16e51bb
cfd6018
74cf64c
f1ce21b
ec1a12e
2c87639
24d84b9
9ac1ebe
03f9495
5c42b05
867caf2
1edd84d
d8b3b31
35d4bf7
b4fe5a6
38225d6
4774710
b6b9e9e
1e9919f
1fea02b
946eb90
359a1bc
41ed2ad
e58adab
2689ca8
671803f
93a827a
3b4b4d2
224b3a9
41ff72e
d952d3a
7d164db
72ba9db
6dcc8c4
a82f984
6019571
3300a89
988c5a3
53aad7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,6 +298,24 @@ def condition_(self, fragment, stepList, key, hasHarvest): | |
'--procModifiers': 'trackingMkFit' | ||
} | ||
|
||
# Vector Hits workflows | ||
class UpgradeWorkflow_vectorHits(UpgradeWorkflow): | ||
def setup_(self, step, stepName, stepDict, k, properties): | ||
stepDict[stepName][k] = merge([{'--procModifiers': 'vectorHits'}, stepDict[step][k]]) | ||
def condition(self, fragment, stepList, key, hasHarvest): | ||
return fragment=="TTbar_14TeV" and '2026' in key | ||
upgradeWFs['vectorHits'] = UpgradeWorkflow_vectorHits( | ||
steps = [ | ||
'Reco', | ||
], | ||
PU = [ | ||
'Reco', | ||
], | ||
suffix = '_vectorHits', | ||
offset = 0.9, | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kpedro88 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just as a sanity check, it's not just me, the cms-bot/jenkins cmdLog for the .9 workflow does not have it either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I must have broken it when doing the last rebase as there were conflicts in this file. Working to fix it... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Phase2 workflows use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That fixes it, thanks! That probably also means that it never actually worked in the first place, sorry! |
||
|
||
|
||
# Patatrack workflows | ||
class UpgradeWorkflowPatatrack(UpgradeWorkflow): | ||
def condition(self, fragment, stepList, key, hasHarvest): | ||
|
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 { | ||
JanFSchulte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
//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; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. given There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really, I don't know with this was made virtual. Removed it. |
||
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; } | ||
JanFSchulte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
//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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is this non const method that return something by value???? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not having it leads to compilation errors because the concrete implementation of the non-const function seems to needed, without it I get the following errors:
|
||
|
||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef DataFormats_TrackerRecHit2D_VectorHit2D_h | ||
#define DataFormats_TrackerRecHit2D_VectorHit2D_h | ||
|
||
JanFSchulte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add both clusters already here/now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure what you are proposing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was my attempt to read the meaning of
//FIXME:: this is just temporary solution for phase2,
,compared to SiStripMatchedRecHit2D