Skip to content

Commit

Permalink
Merged HipMitigation2 from repository VinInn
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn committed Jul 13, 2016
2 parents 652e650 + 9dacf1b commit c06ea3f
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 14 deletions.
Expand Up @@ -14,7 +14,7 @@
Chi2MeasurementEstimatorForP5.nSigma = 4.
Chi2MeasurementEstimatorForP5.MaxDisplacement = 100
Chi2MeasurementEstimatorForP5.MaxSagitta=-1

Chi2MeasurementEstimatorForP5.MinPtForHitRecoveryInGluedDet=100000
# PropagatorWithMaterialESProducer
from TrackingTools.MaterialEffects.MaterialPropagator_cfi import *
# PropagatorWithMaterialESProducer
Expand Down
Expand Up @@ -127,6 +127,7 @@ Chi2ChargeMeasurementEstimatorESProducer::fillDescriptions(edm::ConfigurationDes
desc.add<double>("MaxDisplacement",0.5);
desc.add<double>("MaxSagitta",2.);
desc.add<double>("MinimalTolerance",0.5);
desc.add<double>("MinPtForHitRecoveryInGluedDet",0.9);
desc.add<std::string>("ComponentName","Chi2Charge");
desc.add<double>("pTChargeCutThreshold",-1.);
edm::ParameterSetDescription descCCC = getFilledConfigurationDescription4CCC();
Expand All @@ -153,13 +154,14 @@ Chi2ChargeMeasurementEstimatorESProducer::produce(const TrackingComponentsRecord
auto maxDis = m_pset.getParameter<double>("MaxDisplacement");
auto maxSag = m_pset.getParameter<double>("MaxSagitta");
auto minTol = m_pset.getParameter<double>("MinimalTolerance");
auto minpt = m_pset.getParameter<double>("MinPtForHitRecoveryInGluedDet");
auto minGoodPixelCharge = 0;
auto minGoodStripCharge = clusterChargeCut(m_pset);
auto pTChargeCutThreshold= m_pset.getParameter<double>("pTChargeCutThreshold");

m_estimator = std::make_shared<Chi2ChargeMeasurementEstimator>(
minGoodPixelCharge, minGoodStripCharge, pTChargeCutThreshold,
maxChi2,nSigma, maxDis, maxSag, minTol);
maxChi2,nSigma, maxDis, maxSag, minTol,minpt);

return m_estimator;
}
Expand Down
Expand Up @@ -136,7 +136,7 @@ bool TkGluedMeasurementDet::measurements( const TrajectoryStateOnSurface& stateO
auto id = geomDet().geographicalId().subdetId()-3;
auto l = TOBDetId(geomDet().geographicalId()).layer();
bool killHIP = (1==l) && (2==id); //TOB1
killHIP &= stateOnThisDet.globalMomentum().perp2()>0.81f;
killHIP &= stateOnThisDet.globalMomentum().perp2()>est.minPt2ForHitRecoveryInGluedDet();
if (killHIP) {
result.add(theInactiveHit, 0.F);
return true;
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/MeasurementDet/plugins/doubleMatch.icc
Expand Up @@ -149,7 +149,7 @@ void TkGluedMeasurementDet::doubleMatch(const TrajectoryStateOnSurface& ts, cons
gluedDet, trdir, chelper);
}

if (ts.globalMomentum().perp2()>0.81f) {
if (ts.globalMomentum().perp2()> collector.estimator().minPt2ForHitRecoveryInGluedDet()) {
// if no match found try add mon than try to add stereo...
if (0==collector.size())
projectOnGluedDet( collector, monoHits, glbDir);
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/TrackProducer/interface/TrackProducerBase.icc
Expand Up @@ -162,7 +162,7 @@ TrackProducerBase<T>::setSecondHitPattern(Trajectory* traj, T& track,
std::unique_ptr<Propagator> localProp(prop->clone());

//use negative sigma=-3.0 in order to use a more conservative definition of isInside() for Bounds classes.
Chi2MeasurementEstimator estimator(30.,-3.0,0.5,2.0,0.5); // same as defauts....
Chi2MeasurementEstimator estimator(30.,-3.0,0.5,2.0,0.5,0.9); // same as defauts....

// WARNING: At the moment the trajectories has the measurements with reversed sorting after the track smoothing.
// Therefore the lastMeasurement is the inner one (for LHC-like tracks)
Expand Down
18 changes: 13 additions & 5 deletions TrackingTools/DetLayers/interface/MeasurementEstimator.h
Expand Up @@ -3,7 +3,7 @@

#include "DataFormats/GeometryVector/interface/Vector2DBase.h"
#include "DataFormats/GeometryVector/interface/LocalTag.h"
#include <utility>
#include<limits>

class Plane;
class TrajectoryStateOnSurface;
Expand All @@ -26,9 +26,11 @@ class MeasurementEstimator {


MeasurementEstimator() {}
MeasurementEstimator(float maxSag, float minToll) :
MeasurementEstimator(float maxSag, float minToll, float mpt) :
m_maxSagitta(maxSag),
m_minTolerance2(minToll*minToll){}
m_minTolerance2(minToll*minToll),
m_minPt2ForHitRecoveryInGluedDet(mpt*mpt)
{}

virtual ~MeasurementEstimator() {}

Expand Down Expand Up @@ -75,12 +77,18 @@ class MeasurementEstimator {

float maxSagitta() const { return m_maxSagitta;}
float minTolerance2() const { return m_minTolerance2;}

float minPt2ForHitRecoveryInGluedDet() const { return m_minPt2ForHitRecoveryInGluedDet;}

private:
/*
* why here?
* MeasurementEstimator is the only configurable item that percolates down to geometry event by event (actually hit by hit) and not at initialization time
* It is therefore the natural candidate to collect all parameters that affect pattern-recongnition
* and require to be controlled with higher granularity than job level (such as iteration by iteration)
*/
float m_maxSagitta=-1.; // maximal sagitta for linear approximation
float m_minTolerance2=100.; // square of minimum tolerance ot be considered inside a detector

float m_minPt2ForHitRecoveryInGluedDet=std::numeric_limits<float>::max();
};

#endif // Tracker_MeasurementEstimator_H
Expand Up @@ -22,9 +22,10 @@ class Chi2MeasurementEstimatorBase : public MeasurementEstimator {
explicit Chi2MeasurementEstimatorBase(double maxChi2, double nSigma = 3., float maxDisp=std::numeric_limits<float>::max()) :
theMaxChi2(maxChi2), theNSigma(nSigma), theMaxDisplacement(maxDisp) {}

template<typename... Args>
Chi2MeasurementEstimatorBase(double maxChi2, double nSigma, float maxDisp,
float maxSag, float minToll) :
MeasurementEstimator(maxSag,minToll),
Args && ...args) :
MeasurementEstimator(args...),
theMaxChi2(maxChi2), theNSigma(nSigma), theMaxDisplacement(maxDisp) {}


Expand Down
Expand Up @@ -44,8 +44,9 @@ Chi2MeasurementEstimatorESProducer::produce(const TrackingComponentsRecord & iRe
auto maxDis = m_pset.getParameter<double>("MaxDisplacement");
auto maxSag = m_pset.getParameter<double>("MaxSagitta");
auto minTol = m_pset.getParameter<double>("MinimalTolerance");
auto minpt = m_pset.getParameter<double>("MinPtForHitRecoveryInGluedDet");

m_estimator = std::make_shared<Chi2MeasurementEstimator>(maxChi2,nSigma, maxDis, maxSag, minTol);
m_estimator = std::make_shared<Chi2MeasurementEstimator>(maxChi2,nSigma, maxDis, maxSag, minTol,minpt);
return m_estimator;
}

Expand All @@ -60,6 +61,7 @@ Chi2MeasurementEstimatorESProducer::getFilledConfigurationDescription() {
desc.add<double>("MaxDisplacement",0.5);
desc.add<double>("MaxSagitta",2.);
desc.add<double>("MinimalTolerance",0.5);
desc.add<double>("MinPtForHitRecoveryInGluedDet",9);
return desc;
}
*/
Expand All @@ -74,6 +76,7 @@ Chi2MeasurementEstimatorESProducer::fillDescriptions(edm::ConfigurationDescripti
desc.add<double>("MaxDisplacement",0.5);
desc.add<double>("MaxSagitta",2.);
desc.add<double>("MinimalTolerance",0.5);
desc.add<double>("MinPtForHitRecoveryInGluedDet",0.9);
desc.add<std::string>("ComponentName","Chi2");
descriptions.add("Chi2MeasurementEstimator", desc);
}
Expand Down
Expand Up @@ -28,7 +28,6 @@
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h"
#include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
#include "TrackingTools/TrackFitters/interface/KFTrajectoryFitter.h"
#include "TrackingTools/TrackFitters/interface/KFTrajectorySmoother.h"
#include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h"
Expand Down

0 comments on commit c06ea3f

Please sign in to comment.