48 LogTrace(
"Reco|TrackingTools|SeedTransformer") <<
"SeedTransformer constructor called." << endl << endl;
52 auto fitterName = iConfig.
getParameter<
string>(
"Fitter");
54 auto muonRecHitBuilderName = iConfig.
getParameter<
string>(
"MuonRecHitBuilder");
59 nMinRecHits = iConfig.
getParameter<
unsigned int>(
"NMinRecHits");
60 errorRescale = iConfig.
getParameter<
double>(
"RescaleError");
61 useSubRecHits = iConfig.
getParameter<
bool>(
"UseSubRecHits");
65 LogTrace(
"Reco|TrackingTools|SeedTransformer") <<
"SeedTransformer destructor called." << endl << endl;
69 theTrackingGeometry = &iSetup.
getData(theTrackingGeometryToken);
70 theMagneticField = &iSetup.
getData(theMagneticFieldToken);
71 theFitter = &iSetup.
getData(theFitterToken);
72 theMuonRecHitBuilder = &iSetup.
getData(theMuonRecHitBuilderToken);
73 thePropagator = &iSetup.
getData(thePropagatorToken);
77 const string metname =
"Reco|TrackingTools|SeedTransformer";
81 if (aSeed.
nHits() < nMinRecHits) {
82 LogTrace(
metname) <<
" --- Too few RecHits, no refit performed! ---" << endl;
83 return vector<Trajectory>();
91 vector<TransientTrackingRecHit::ConstRecHitPointer>
recHits;
100 copy(subHits.begin(), subHits.end(), back_inserter(
recHits));
110 LogTrace(
metname) <<
" --- Initial state for refit not valid! ---" << endl;
111 return vector<Trajectory>();
114 vector<Trajectory> refittedSeed = theFitter->fit(aSeed,
recHits, aInitTSOS);
116 if (refittedSeed.empty()) {
118 return vector<Trajectory>();
121 else if (!refittedSeed.front().isValid()) {
122 LogTrace(
metname) <<
" --- Seed fitted, but trajectory not valid! ---" << endl;
123 return vector<Trajectory>();
135 const GeomDet* tmpGeomDet = theTrackingGeometry->idToDet(tmpDetId);
void rescaleError(double factor)
T getParameter(std::string const &) const
const std::string metname
RecHitRange recHits() const
unsigned int detId() const
static TransientTrackingRecHit::ConstRecHitContainer breakInSubRecHits(TransientTrackingRecHit::ConstRecHitPointer, int granularity)
takes a muon rechit and returns its sub-rechits given a certain granularity
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
unsigned int nHits() const
bool getData(T &iHolder) const
PTrajectoryStateOnDet const & startingState() const
std::vector< ConstRecHitPointer > ConstRecHitContainer