-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Technical optimisation of e/gamma (local)covariances function (11_3_X) #33270
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -185,11 +185,11 @@ class EcalClusterToolsT { | |||||||||||
|
||||||||||||
// return a vector v with v[0] = covEtaEta, v[1] = covEtaPhi, v[2] = covPhiPhi | ||||||||||||
|
||||||||||||
static std::vector<float> covariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
const CaloGeometry *geometry, | ||||||||||||
float w0 = 4.7); | ||||||||||||
static std::array<float, 3> covariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
const CaloGeometry *geometry, | ||||||||||||
float w0 = 4.7); | ||||||||||||
|
||||||||||||
// return a vector v with v[0] = covIEtaIEta, v[1] = covIEtaIPhi, v[2] = covIPhiIPhi | ||||||||||||
//this function calculates differences in eta/phi in units of crystals not global eta/phi | ||||||||||||
|
@@ -199,18 +199,18 @@ class EcalClusterToolsT { | |||||||||||
// | ||||||||||||
//Warning: covIEtaIEta has been studied by egamma, but so far covIPhiIPhi hasnt been studied extensively so there could be a bug in | ||||||||||||
// the covIPhiIEta or covIPhiIPhi calculations. I dont think there is but as it hasnt been heavily used, there might be one | ||||||||||||
static std::vector<float> localCovariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
float w0 = EgammaLocalCovParamDefaults::kRelEnCut, | ||||||||||||
const EcalPFRecHitThresholds *thresholds = nullptr, | ||||||||||||
float multEB = 0.0, | ||||||||||||
float multEE = 0.0); | ||||||||||||
|
||||||||||||
static std::vector<float> scLocalCovariances(const reco::SuperCluster &cluster, | ||||||||||||
static std::array<float, 3> localCovariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
float w0 = 4.7); | ||||||||||||
float w0 = EgammaLocalCovParamDefaults::kRelEnCut, | ||||||||||||
const EcalPFRecHitThresholds *thresholds = nullptr, | ||||||||||||
float multEB = 0.0, | ||||||||||||
float multEE = 0.0); | ||||||||||||
|
||||||||||||
static std::array<float, 3> scLocalCovariances(const reco::SuperCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
float w0 = 4.7); | ||||||||||||
|
||||||||||||
// cluster second moments with respect to principal axes: | ||||||||||||
static Cluster2ndMoments cluster2ndMoments(const reco::BasicCluster &basicCluster, | ||||||||||||
|
@@ -960,11 +960,11 @@ std::pair<float, float> EcalClusterToolsT<noZS>::mean5x5PositionInXY(const reco: | |||||||||||
} | ||||||||||||
|
||||||||||||
template <bool noZS> | ||||||||||||
std::vector<float> EcalClusterToolsT<noZS>::covariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
const CaloGeometry *geometry, | ||||||||||||
float w0) { | ||||||||||||
std::array<float, 3> EcalClusterToolsT<noZS>::covariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
const CaloGeometry *geometry, | ||||||||||||
float w0) { | ||||||||||||
float e_5x5 = e5x5(cluster, recHits, topology); | ||||||||||||
float covEtaEta, covEtaPhi, covPhiPhi; | ||||||||||||
if (e_5x5 >= 0.) { | ||||||||||||
|
@@ -1025,10 +1025,10 @@ std::vector<float> EcalClusterToolsT<noZS>::covariances(const reco::BasicCluster | |||||||||||
covEtaPhi = 0; | ||||||||||||
covPhiPhi = 0; | ||||||||||||
} | ||||||||||||
std::vector<float> v; | ||||||||||||
v.push_back(covEtaEta); | ||||||||||||
v.push_back(covEtaPhi); | ||||||||||||
v.push_back(covPhiPhi); | ||||||||||||
std::array<float, 3> v; | ||||||||||||
v[0] = covEtaEta; | ||||||||||||
v[1] = covEtaPhi; | ||||||||||||
v[2] = covPhiPhi; | ||||||||||||
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. here and everywhere else
Suggested change
|
||||||||||||
return v; | ||||||||||||
} | ||||||||||||
|
||||||||||||
|
@@ -1037,13 +1037,13 @@ std::vector<float> EcalClusterToolsT<noZS>::covariances(const reco::BasicCluster | |||||||||||
//it also does not require any eta correction function in the endcap | ||||||||||||
//it is multipled by an approprate crystal size to ensure it gives similar values to covariances(...) | ||||||||||||
template <bool noZS> | ||||||||||||
std::vector<float> EcalClusterToolsT<noZS>::localCovariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
float w0, | ||||||||||||
const EcalPFRecHitThresholds *thresholds, | ||||||||||||
float multEB, | ||||||||||||
float multEE) { | ||||||||||||
std::array<float, 3> EcalClusterToolsT<noZS>::localCovariances(const reco::BasicCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
float w0, | ||||||||||||
const EcalPFRecHitThresholds *thresholds, | ||||||||||||
float multEB, | ||||||||||||
float multEE) { | ||||||||||||
float e_5x5 = e5x5(cluster, recHits, topology); | ||||||||||||
float covEtaEta, covEtaPhi, covPhiPhi; | ||||||||||||
|
||||||||||||
|
@@ -1125,10 +1125,10 @@ std::vector<float> EcalClusterToolsT<noZS>::localCovariances(const reco::BasicCl | |||||||||||
covEtaPhi = 0; | ||||||||||||
covPhiPhi = 0; | ||||||||||||
} | ||||||||||||
std::vector<float> v; | ||||||||||||
v.push_back(covEtaEta); | ||||||||||||
v.push_back(covEtaPhi); | ||||||||||||
v.push_back(covPhiPhi); | ||||||||||||
std::array<float, 3> v; | ||||||||||||
v[0] = covEtaEta; | ||||||||||||
v[1] = covEtaPhi; | ||||||||||||
v[2] = covPhiPhi; | ||||||||||||
return v; | ||||||||||||
} | ||||||||||||
|
||||||||||||
|
@@ -1384,10 +1384,10 @@ float EcalClusterToolsT<noZS>::getDPhiEndcap(const DetId &crysId, float meanX, f | |||||||||||
} | ||||||||||||
|
||||||||||||
template <bool noZS> | ||||||||||||
std::vector<float> EcalClusterToolsT<noZS>::scLocalCovariances(const reco::SuperCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
float w0) { | ||||||||||||
std::array<float, 3> EcalClusterToolsT<noZS>::scLocalCovariances(const reco::SuperCluster &cluster, | ||||||||||||
const EcalRecHitCollection *recHits, | ||||||||||||
const CaloTopology *topology, | ||||||||||||
float w0) { | ||||||||||||
const reco::BasicCluster bcluster = *(cluster.seed()); | ||||||||||||
|
||||||||||||
float e_5x5 = e5x5(bcluster, recHits, topology); | ||||||||||||
|
@@ -1453,10 +1453,10 @@ std::vector<float> EcalClusterToolsT<noZS>::scLocalCovariances(const reco::Super | |||||||||||
covPhiPhi = 0; | ||||||||||||
} | ||||||||||||
|
||||||||||||
std::vector<float> v; | ||||||||||||
v.push_back(covEtaEta); | ||||||||||||
v.push_back(covEtaPhi); | ||||||||||||
v.push_back(covPhiPhi); | ||||||||||||
std::array<float, 3> v; | ||||||||||||
v[0] = covEtaEta; | ||||||||||||
v[1] = covEtaPhi; | ||||||||||||
v[2] = covPhiPhi; | ||||||||||||
|
||||||||||||
return v; | ||||||||||||
} | ||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
to capture the return it would be better to use auto everywhere
or
I'm not sure which is better honestly, @VinInn what do you think?