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";
79 LogTrace(metname) <<
" Number of valid RecHits: " << aSeed.
nHits() << endl;
81 if (aSeed.
nHits() < nMinRecHits) {
82 LogTrace(metname) <<
" --- Too few RecHits, no refit performed! ---" << endl;
83 return vector<Trajectory>();
91 vector<TransientTrackingRecHit::ConstRecHitPointer>
recHits;
93 for (
auto const& recHit : aSeed.
recHits()) {
94 if (recHit.isValid()) {
100 copy(subHits.begin(), subHits.end(), back_inserter(recHits));
102 recHits.push_back(ttrh);
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()) {
117 LogTrace(metname) <<
" --- Seed fit failed! ---" << endl;
118 return vector<Trajectory>();
121 else if (!refittedSeed.front().isValid()) {
122 LogTrace(metname) <<
" --- Seed fitted, but trajectory not valid! ---" << endl;
123 return vector<Trajectory>();
127 LogTrace(metname) <<
" +++ Seed fit succeded! +++" << endl;
135 const GeomDet* tmpGeomDet = theTrackingGeometry->idToDet(tmpDetId);
void rescaleError(double factor)
const std::string metname
bool getData(T &iHolder) const
static TransientTrackingRecHit::ConstRecHitContainer breakInSubRecHits(TransientTrackingRecHit::ConstRecHitPointer, int granularity)
takes a muon rechit and returns its sub-rechits given a certain granularity
const SurfaceType & surface() const
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
unsigned int detId() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
RecHitRange recHits() const
PTrajectoryStateOnDet const & startingState() const
T getParameter(std::string const &) const
unsigned int nHits() const