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
Timing propagation in HGCAL RECO #28740
Changes from 20 commits
f4eefb9
d050141
8bf5b4e
70645df
4b1699a
b3468b0
97060fe
c96769c
60fb5a9
36c7da3
ac606af
3f665f9
cfb9ee2
cd378b8
5443928
f2ecedb
716ae7c
55493e9
2f95595
60d3b8c
8b212f6
231b930
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ void HGCGraph::makeAndConnectDoublets(const TICLLayerTiles &histo, | |
int nPhiBins, | ||
const std::vector<reco::CaloCluster> &layerClusters, | ||
const std::vector<float> &mask, | ||
const edm::ValueMap<float> &layerClustersTime, | ||
const edm::ValueMap<std::pair<float, float>> &layerClustersTime, | ||
int deltaIEta, | ||
int deltaIPhi, | ||
float minCosTheta, | ||
|
@@ -125,12 +125,15 @@ void HGCGraph::makeAndConnectDoublets(const TICLLayerTiles &histo, | |
|
||
bool HGCGraph::areTimeCompatible(int innerIdx, | ||
int outerIdx, | ||
const edm::ValueMap<float> &layerClustersTime, | ||
const edm::ValueMap<std::pair<float, float>> &layerClustersTime, | ||
float maxDeltaTime) { | ||
float timeIn = layerClustersTime.get(innerIdx); | ||
float timeOut = layerClustersTime.get(outerIdx); | ||
float timeIn = layerClustersTime.get(innerIdx).first; | ||
float timeInE = layerClustersTime.get(innerIdx).second; | ||
float timeOut = layerClustersTime.get(outerIdx).first; | ||
float timeOutE = layerClustersTime.get(outerIdx).second; | ||
|
||
return (timeIn == -99 || timeOut == -99 || std::abs(timeIn - timeOut) < maxDeltaTime); | ||
return (timeIn == -99 || timeOut == -99 || | ||
std::abs(timeIn - timeOut) < maxDeltaTime * sqrt(timeInE * timeInE + timeOutE * timeOutE)); | ||
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. Would it make sense to also check that the Time Error is meaningful, i.e. it is >0? 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. No, should not be the case:
If apart from this timeError is <= 0, it is for a bug somewhere else in the chain. Can I suggest to leave this as it is? (to help spotting the bug in case?) 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. Sure, thanks for checking! |
||
} | ||
|
||
//also return a vector of seedIndex for the reconstructed tracksters | ||
|
@@ -141,7 +144,7 @@ void HGCGraph::findNtuplets(std::vector<HGCDoublet::HGCntuplet> &foundNtuplets, | |
unsigned int maxOutInHops) { | ||
HGCDoublet::HGCntuplet tmpNtuplet; | ||
tmpNtuplet.reserve(minClustersPerNtuplet); | ||
std::vector<std::pair<unsigned int, unsigned int> > outInToVisit; | ||
std::vector<std::pair<unsigned int, unsigned int>> outInToVisit; | ||
for (auto rootDoublet : theRootDoublets_) { | ||
tmpNtuplet.clear(); | ||
outInToVisit.clear(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#ifndef RecoLocalCalo_HGCalRecProducers_ComputeClusterTime_h | ||
#define RecoLocalCalo_HGCalRecProducers_ComputeClusterTime_h | ||
|
||
// user include files | ||
#include <algorithm> | ||
#include <cmath> | ||
#include <numeric> | ||
#include <vector> | ||
#include <string> | ||
|
||
// functions to select the hits to compute the time of a given cluster | ||
// start with the only hits with timing information | ||
// average among the hits contained in the chosen time interval | ||
// weighted average wrt resolution or preferred function | ||
|
||
// N.B. time is corrected wrt vtx-calorimeter distance | ||
// with straight line and light speed hypothesis | ||
// for charged tracks or heavy particles (longer track length or beta < 1) | ||
// need to correct the offset at analysis level | ||
|
||
namespace hgcalsimclustertime { | ||
|
||
class ComputeClusterTime { | ||
public: | ||
ComputeClusterTime(float Xmix, float Xmax, float Cterm, float Aterm); | ||
ComputeClusterTime(); | ||
|
||
void setParameters(float Xmix, float Xmax, float Cterm, float Aterm); | ||
|
||
//time resolution parametrization | ||
float timeResolution(float xVal); | ||
|
||
float getTimeError(std::string type, float xVal); | ||
|
||
//time-interval based on that ~210ps wide and with the highest number of hits | ||
//apply weights if provided => weighted mean | ||
//return also error on the mean | ||
//only effective with a minimum number of hits with time (3 from TDR time) | ||
std::pair<float, float> fixSizeHighestDensity(std::vector<float>& time, | ||
std::vector<float> weight = std::vector<float>(), | ||
unsigned int minNhits = 3, | ||
float deltaT = 0.210, /*time window in ns*/ | ||
float timeWidthBy = 0.5); | ||
|
||
private: | ||
float _Xmin; | ||
float _Xmax; | ||
float _Cterm; | ||
float _Aterm; | ||
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. leading underscores are frowned upon; please use a trailing (or prepend something, like "m") to denote the member data |
||
}; | ||
|
||
} // namespace hgcalsimclustertime | ||
|
||
#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.
Should this go in DataFormats/StdDictionaries?
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 had missed that this was a ValueMap. It definitely should stay here.