Skip to content
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

Adding time threshold compatibility to MTDThresholdClusterizer #25644

Merged
merged 4 commits into from Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -71,6 +71,7 @@ class MTDThresholdClusterizer : public MTDClusterizerBase {
float theHitThreshold; // Hit threshold
float theSeedThreshold; // MTD cluster seed
float theClusterThreshold; // Cluster threshold
float theTimeThreshold; // Time compatibility between new hit and seed

//! Geometry-related information
int theNumOfRows;
Expand Down
Expand Up @@ -109,6 +109,7 @@ MTDClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& description
desc.add<double>("HitThreshold", 0.);
desc.add<double>("SeedThreshold", 0.);
desc.add<double>("ClusterThreshold", 0.);
desc.add<double>("TimeThreshold", 10.);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a leftover/incomplete code review from #25063

the 4 lines above should be replaced by a single call
MTDThresholdClusterizer::fillDescriptions(desc);

descriptions.add("mtdClusterProducer", desc);
}

Expand Down
Expand Up @@ -31,6 +31,7 @@ MTDThresholdClusterizer::MTDThresholdClusterizer
theHitThreshold( conf.getParameter<double>("HitThreshold") ),
theSeedThreshold( conf.getParameter<double>("SeedThreshold") ),
theClusterThreshold( conf.getParameter<double>("ClusterThreshold") ),
theTimeThreshold( conf.getParameter<double>("TimeThreshold") ),
theNumOfRows(0), theNumOfCols(0), theCurrentId(0),
theBuffer(theNumOfRows, theNumOfCols ),
bufferAlreadySet(false)
Expand All @@ -46,6 +47,7 @@ MTDThresholdClusterizer::fillDescriptions(edm::ParameterSetDescription& desc) {
desc.add<double>("HitThreshold", 0.);
desc.add<double>("SeedThreshold", 0.);
desc.add<double>("ClusterThreshold", 0.);
desc.add<double>("TimeThreshold", 10.);
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -256,6 +258,8 @@ MTDThresholdClusterizer::make_cluster( const FTLCluster::FTLHitPos& hit )
for ( auto c = std::max(0,int(acluster.y[curInd]-1)); c < std::min(int(acluster.y[curInd]+2),int(theBuffer.columns())) && !stopClus; ++c) {
for ( auto r = std::max(0,int(acluster.x[curInd]-1)); r < std::min(int(acluster.x[curInd]+2),int(theBuffer.rows())) && !stopClus; ++r) {
if ( theBuffer.energy(r,c) > theHitThreshold) {
if (fabs(theBuffer.time(r,c) - seed_time) > theTimeThreshold*sqrt( theBuffer.time_error(r,c)*theBuffer.time_error(r,c) + seed_time_error*seed_time_error))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::abs

continue;
FTLCluster::FTLHitPos newhit(r,c);
if (!acluster.add( newhit, theBuffer.energy(r,c), theBuffer.time(r,c), theBuffer.time_error(r,c)))
{
Expand Down