48 theSeedsToken = consumes<TrajectorySeedCollection>(theSeedsLabel);
55 produces<reco::TrackCollection>().setBranchAlias(theAlias +
"Tracks");
64 if (theService)
delete theService;
65 if (theUpdatorAtVtx)
delete theUpdatorAtVtx;
81 theService->update(eventSetup);
90 event.getByToken(theSeedsToken, seeds);
92 for ( TrajectorySeedCollection::const_iterator iSeed = seeds->begin();
93 iSeed != seeds->end(); iSeed++ ) {
94 pair<bool,reco::Track> resultOfTrackExtrapAtPCA = buildTrackAtPCA(*iSeed);
95 if(!resultOfTrackExtrapAtPCA.first)
continue;
99 trackCollection->push_back(track);
136 const GeomDet* gdet = theService->trackingGeometry()->idToDet( seedDetId );
172 const string metname =
"MuonSeedTrack";
176 TSOS seedTSOS = getSeedTSOS(seed);
178 LogTrace(metname) <<
"Propagate to PCA...";
179 pair<bool,FreeTrajectoryState>
180 extrapolationResult = theUpdatorAtVtx->propagateToNominalLine(seedTSOS);
183 if(extrapolationResult.first) {
184 ftsAtVtx = extrapolationResult.second;
187 LogWarning(metname) <<
"Track in the Tracker: taking the innermost state instead of the state at PCA";
191 if ( theAllowNoVtxFlag ) {
192 LogWarning(metname) <<
"Propagation to PCA failed, taking the innermost state instead of the state at PCA";
195 LogWarning(metname) <<
"Stand Alone track: this track will be rejected";
196 return pair<bool,reco::Track>(
false,
reco::Track());
201 LogTrace(metname) <<
"TSOS after the extrapolation at vtx";
209 double dummyNDOF = 1.0;
211 double dummyChi2 = 1.0;
220 return pair<bool,reco::Track>(
true,
track);
227 const string metname =
"MuonSeedTrack";
234 if ((*recHits1).isValid()) ndof += (*recHits1).dimension();
235 if ((*recHits2).isValid()) ndof += (*recHits2).dimension();
243 return max(ndof - 5., 0.);
~MuonSeedTrack() override
destructor
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
TrajectoryStateOnSurface TSOS
static bool isInside(const GlobalPoint &)
const std::string metname
std::vector< Track > TrackCollection
collection of Tracks
GlobalPoint globalPosition() const
TrackCharge charge() const
double computeNDOF(const TrajectorySeed &) const
compute the TrajectorySeed's degree of freedom
const CurvilinearTrajectoryError & curvilinearError() const
std::string dumpFTS(const FreeTrajectoryState &fts) const
recHitContainer::const_iterator const_iterator
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::pair< bool, reco::Track > buildTrackAtPCA(const TrajectorySeed &) const
Build a track at the PCA WITHOUT any vertex constriant.
unsigned int detId() const
GlobalVector momentum() const
GlobalPoint position() const
PTrajectoryStateOnDet const & startingState() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
TrajectoryStateOnSurface getSeedTSOS(const TrajectorySeed &seed) const
get the TrajectorySeed's TrajectoryStateOnSurface
void endJob() override
post-job
MuonSeedTrack(const edm::ParameterSet &)
constructor with config
void produce(edm::Event &, const edm::EventSetup &) override
construct proto-tracks
void beginJob() override
pre-job booking