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

Option to use old CPE error if charge exceeds one MIP #6831

Merged
merged 1 commit into from Dec 12, 2014
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -20,6 +20,10 @@ class StripCPEfromTrackAngle : public StripCPE
//Set to true if we are using the old error parameterization
const bool useLegacyError;

//Clusters with charge/path > this cut will use old error parameterization
// (overridden by useLegacyError; negative value disables the cut)
const float maxChgOneMIP;

public:
StripClusterParameterEstimator::LocalValues
localParameters( const SiStripCluster&, const GeomDetUnit&, const LocalTrajectoryParameters&) const;
Expand All @@ -36,6 +40,7 @@ class StripCPEfromTrackAngle : public StripCPE
const SiStripLatency& latency)
: StripCPE(conf, mag, geom, lorentz, backPlaneCorrection, confObj, latency )
, useLegacyError(conf.existsAs<bool>("useLegacyError") ? conf.getParameter<bool>("useLegacyError") : true)
, maxChgOneMIP(conf.existsAs<float>("maxChgOneMIP") ? conf.getParameter<double>("maxChgOneMIP") : -6000.)
{
mLC_P[0] = conf.existsAs<double>("mLC_P0") ? conf.getParameter<double>("mLC_P0") : -.326;
mLC_P[1] = conf.existsAs<double>("mLC_P1") ? conf.getParameter<double>("mLC_P1") : .618;
Expand Down
Expand Up @@ -17,4 +17,5 @@
mTEC_P0 = cms.double(-1.885),
mTEC_P1 = cms.double( .471),
useLegacyError = cms.bool(True),
maxChgOneMIP = cms.double(-6000.)
)
@@ -1,5 +1,6 @@
#include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPEfromTrackAngle.h"
#include "Geometry/CommonTopologies/interface/StripTopology.h"
#include "DataFormats/SiStripCluster/interface/SiStripClusterTools.h"

#include "vdt/vdtMath.h"

Expand Down Expand Up @@ -38,7 +39,15 @@ localParameters( const SiStripCluster& cluster, const GeomDetUnit& det, const Lo

const unsigned N = cluster.amplitudes().size();
const float fullProjection = p.coveredStrips( track+p.drift, ltp.position());
const float uerr2 = useLegacyError || cluster.isMerged() ? legacyStripErrorSquared(N,std::abs(fullProjection)) : stripErrorSquared( N, std::abs(fullProjection),ssdid.subDetector() );
float uerr2;
if (useLegacyError) {
uerr2 = legacyStripErrorSquared(N,std::abs(fullProjection));
} else if (maxChgOneMIP < 0.0) {
uerr2 = cluster.isMerged() ? legacyStripErrorSquared(N,std::abs(fullProjection)) : stripErrorSquared( N, std::abs(fullProjection),ssdid.subDetector() );
} else {
float dQdx = siStripClusterTools::chargePerCM(ssdid, cluster, ltp);
uerr2 = dQdx > maxChgOneMIP ? legacyStripErrorSquared(N,std::abs(fullProjection)) : stripErrorSquared( N, std::abs(fullProjection),ssdid.subDetector() );
}
const float strip = cluster.barycenter() - 0.5f*(1.f-p.backplanecorrection) * fullProjection
+ 0.5f*p.coveredStrips(track, ltp.position());

Expand Down