CMS 3D CMS Logo

Public Member Functions | Protected Attributes | Private Member Functions

SeedFromConsecutiveHitsCreator Class Reference

#include <SeedFromConsecutiveHitsCreator.h>

Inheritance diagram for SeedFromConsecutiveHitsCreator:
SeedCreator GCC11_FINAL< T, TOPO > GCC11_FINAL< T, TOPO >

List of all members.

Public Member Functions

virtual void init (const TrackingRegion &region, const edm::EventSetup &es, const SeedComparitor *filter) GCC11_FINAL
virtual void makeSeed (TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits) GCC11_FINAL
 SeedFromConsecutiveHitsCreator (const std::string &propagator="PropagatorWithMaterial", double seedMomentumForBOFF=-5.0, double aOriginTransverseErrorMultiplier=1.0, double aMinOneOverPtError=1.0)
 SeedFromConsecutiveHitsCreator (const edm::ParameterSet &cfg)
virtual ~SeedFromConsecutiveHitsCreator ()

Protected Attributes

edm::ESHandle< MagneticFieldbfield
const SeedComparitorfilter = nullptr
bool isBOFF = false
float nomField
edm::ESHandle< PropagatorpropagatorHandle
const TrackingRegionregion = nullptr
double theBOFFMomentum
double theMinOneOverPtError
double theOriginTransverseErrorMultiplier
std::string thePropagatorLabel
edm::ESHandle< TrackerGeometrytracker

Private Member Functions

void buildSeed (TrajectorySeedCollection &seedCollection, const SeedingHitSet &hits, const FreeTrajectoryState &fts) const dso_hidden
bool checkHit (const TrajectoryStateOnSurface &tsos, const TransientTrackingRecHit::ConstRecHitPointer &hit) const dso_hidden
CurvilinearTrajectoryError initialError (float sin2Theta) const dso_hidden
virtual bool initialKinematic (GlobalTrajectoryParameters &kine, const SeedingHitSet &hits) const
TransientTrackingRecHit::RecHitPointer refitHit (const TransientTrackingRecHit::ConstRecHitPointer &hit, const TrajectoryStateOnSurface &state) const dso_hidden

Detailed Description

Definition at line 15 of file SeedFromConsecutiveHitsCreator.h.


Constructor & Destructor Documentation

SeedFromConsecutiveHitsCreator::SeedFromConsecutiveHitsCreator ( const edm::ParameterSet cfg) [inline]

Definition at line 18 of file SeedFromConsecutiveHitsCreator.h.

                                                              :
    thePropagatorLabel(cfg.getParameter<std::string>("propagator")),
    theBOFFMomentum(cfg.existsAs<double>("SeedMomentumForBOFF") ? cfg.getParameter<double>("SeedMomentumForBOFF") : 5.0),
    theOriginTransverseErrorMultiplier(cfg.existsAs<double>("OriginTransverseErrorMultiplier") ? cfg.getParameter<double>("OriginTransverseErrorMultiplier") : 1.0),
    theMinOneOverPtError(cfg.existsAs<double>("MinOneOverPtError") ? cfg.getParameter<double>("MinOneOverPtError") : 1.0)
      {}
SeedFromConsecutiveHitsCreator::SeedFromConsecutiveHitsCreator ( const std::string &  propagator = "PropagatorWithMaterial",
double  seedMomentumForBOFF = -5.0,
double  aOriginTransverseErrorMultiplier = 1.0,
double  aMinOneOverPtError = 1.0 
) [inline]

Definition at line 25 of file SeedFromConsecutiveHitsCreator.h.

    : thePropagatorLabel(propagator), theBOFFMomentum(seedMomentumForBOFF), 
    theOriginTransverseErrorMultiplier(aOriginTransverseErrorMultiplier), theMinOneOverPtError(aMinOneOverPtError) { }
SeedFromConsecutiveHitsCreator::~SeedFromConsecutiveHitsCreator ( ) [virtual]

Definition at line 23 of file SeedFromConsecutiveHitsCreator.cc.

{}

Member Function Documentation

void SeedFromConsecutiveHitsCreator::buildSeed ( TrajectorySeedCollection seedCollection,
const SeedingHitSet hits,
const FreeTrajectoryState fts 
) const [private]

Definition at line 106 of file SeedFromConsecutiveHitsCreator.cc.

References alongMomentum, checkHit(), SeedComparitor::compatible(), filter, TrackingRecHit::geographicalId(), TrajectoryStateOnSurface::isValid(), trajectoryStateTransform::persistentState(), Propagator::propagate(), LargeD0_PixelPairStep_cff::propagator, edm::OwnVector< T, P >::push_back(), DetId::rawId(), refitHit(), SeedingHitSet::size(), and tracker.

Referenced by makeSeed().

{
  const Propagator*  propagator = &(*propagatorHandle);
  
  // get updator
  KFUpdator  updator;
  
  // Now update initial state track using information from seed hits.
  
  TrajectoryStateOnSurface updatedState;
  edm::OwnVector<TrackingRecHit> seedHits;
  
  const TrackingRecHit* hit = 0;
  for ( unsigned int iHit = 0; iHit < hits.size(); iHit++) {
    hit = hits[iHit]->hit();
    TrajectoryStateOnSurface state = (iHit==0) ? 
      propagator->propagate(fts,tracker->idToDet(hit->geographicalId())->surface())
      : propagator->propagate(updatedState, tracker->idToDet(hit->geographicalId())->surface());
    if (!state.isValid()) return;
    
    TransientTrackingRecHit::ConstRecHitPointer const &  tth = hits[iHit]; 
    
    TransientTrackingRecHit::RecHitPointer const & newtth = refitHit( tth, state);
    
    if (!checkHit(state,newtth)) return;

    updatedState =  updator.update(state, *newtth);
    if (!updatedState.isValid()) return;
    
    seedHits.push_back(newtth->hit()->clone());

  } 

  
  PTrajectoryStateOnDet const & PTraj = 
    trajectoryStateTransform::persistentState(updatedState, hit->geographicalId().rawId());
  TrajectorySeed seed(PTraj,std::move(seedHits),alongMomentum); 
  if ( !filter || filter->compatible(seed)) seedCollection.push_back(seed);

}
bool SeedFromConsecutiveHitsCreator::checkHit ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit::ConstRecHitPointer hit 
) const [private]

Definition at line 158 of file SeedFromConsecutiveHitsCreator.cc.

References SeedComparitor::compatible(), and filter.

Referenced by buildSeed().

{ 
    return (filter ? filter->compatible(tsos,hit) : true); 
}
void SeedFromConsecutiveHitsCreator::init ( const TrackingRegion region,
const edm::EventSetup es,
const SeedComparitor filter 
) [virtual]

Implements SeedCreator.

Definition at line 25 of file SeedFromConsecutiveHitsCreator.cc.

References bfield, filter, edm::EventSetup::get(), isBOFF, nomField, propagatorHandle, region, thePropagatorLabel, and tracker.

Referenced by SeedGeneratorFromProtoTracksEDProducer::produce().

                                         {
  region = &iregion;
  filter = ifilter;
  // get tracker
  es.get<TrackerDigiGeometryRecord>().get(tracker);
  // get propagator
  es.get<TrackingComponentsRecord>().get(thePropagatorLabel, propagatorHandle);
  // mag field
  es.get<IdealMagneticFieldRecord>().get(bfield);
  nomField = bfield->nominalValue();
  isBOFF = (0==nomField);  
}
CurvilinearTrajectoryError SeedFromConsecutiveHitsCreator::initialError ( float  sin2Theta) const [private]

Definition at line 85 of file SeedFromConsecutiveHitsCreator.cc.

References funct::C, max(), TrackingRegion::originRBound(), TrackingRegion::originZBound(), TrackingRegion::ptMin(), region, funct::sqr(), theMinOneOverPtError, and theOriginTransverseErrorMultiplier.

Referenced by makeSeed().

{
  // Set initial uncertainty on track parameters, using only P.V. constraint and no hit
  // information.
  AlgebraicSymMatrix55 C = ROOT::Math::SMatrixIdentity();

// FIXME: minC00. Prevent apriori uncertainty in 1/P from being too small, 
// to avoid instabilities.
// N.B. This parameter needs optimising ...
  // Probably OK based on quick study: KS 22/11/12.
  float sin2th = sin2Theta;
  float minC00 = sqr(theMinOneOverPtError);
  C[0][0] = std::max(sin2th/sqr(region->ptMin()), minC00);
  float zErr = sqr(region->originZBound());
  float transverseErr = sqr(theOriginTransverseErrorMultiplier*region->originRBound());
  C[3][3] = transverseErr;
  C[4][4] = zErr*sin2th + transverseErr*(1.f-sin2th);

  return CurvilinearTrajectoryError(C);
}
bool SeedFromConsecutiveHitsCreator::initialKinematic ( GlobalTrajectoryParameters kine,
const SeedingHitSet hits 
) const [private, virtual]

Reimplemented in GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

Definition at line 57 of file SeedFromConsecutiveHitsCreator.cc.

References bfield, GlobalTrajectoryParameters::charge(), SeedComparitor::compatible(), filter, isBOFF, GlobalTrajectoryParameters::momentum(), nomField, TrackingRegion::origin(), GlobalTrajectoryParameters::position(), region, theBOFFMomentum, Vector3DBase< T, FrameTag >::unit(), and unlikely.

Referenced by makeSeed().

                                                                                       {

  TransientTrackingRecHit::ConstRecHitPointer tth1 = hits[0];
  TransientTrackingRecHit::ConstRecHitPointer tth2 = hits[1];
  const GlobalPoint& vertexPos = region->origin();

  FastHelix helix(tth2->globalPosition(), tth1->globalPosition(), vertexPos, nomField,&*bfield);
  if (helix.isValid()) {
    kine = helix.stateAtVertex();
  } else {
    GlobalVector initMomentum(tth2->globalPosition() - vertexPos);
    initMomentum *= (100./initMomentum.perp()); 
    kine = GlobalTrajectoryParameters(vertexPos, initMomentum, 1, &*bfield);
  } 

  if unlikely(isBOFF && (theBOFFMomentum > 0)) {
      kine = GlobalTrajectoryParameters(kine.position(),
                                        kine.momentum().unit() * theBOFFMomentum,
                                        kine.charge(),
                                        &*bfield);
  }
  return (filter ? filter->compatible(hits, kine, helix, *region) : true); 
}
void SeedFromConsecutiveHitsCreator::makeSeed ( TrajectorySeedCollection seedCollection,
const SeedingHitSet hits 
) [virtual]
TransientTrackingRecHit::RecHitPointer SeedFromConsecutiveHitsCreator::refitHit ( const TransientTrackingRecHit::ConstRecHitPointer hit,
const TrajectoryStateOnSurface state 
) const [private]

Definition at line 150 of file SeedFromConsecutiveHitsCreator.cc.

Referenced by buildSeed().

{
  return hit->clone(state);
}

Member Data Documentation

Definition at line 76 of file SeedFromConsecutiveHitsCreator.h.

Referenced by init(), and initialKinematic().

Definition at line 73 of file SeedFromConsecutiveHitsCreator.h.

Referenced by buildSeed(), checkHit(), init(), and initialKinematic().

bool SeedFromConsecutiveHitsCreator::isBOFF = false [protected]

Definition at line 78 of file SeedFromConsecutiveHitsCreator.h.

Referenced by init(), and initialKinematic().

Definition at line 77 of file SeedFromConsecutiveHitsCreator.h.

Referenced by init(), and initialKinematic().

Definition at line 75 of file SeedFromConsecutiveHitsCreator.h.

Referenced by init().

Definition at line 72 of file SeedFromConsecutiveHitsCreator.h.

Referenced by init(), initialError(), and initialKinematic().

Definition at line 68 of file SeedFromConsecutiveHitsCreator.h.

Referenced by initialKinematic().

Definition at line 70 of file SeedFromConsecutiveHitsCreator.h.

Referenced by initialError().

Definition at line 69 of file SeedFromConsecutiveHitsCreator.h.

Referenced by initialError().

Definition at line 67 of file SeedFromConsecutiveHitsCreator.h.

Referenced by init().

Definition at line 74 of file SeedFromConsecutiveHitsCreator.h.

Referenced by buildSeed(), and init().