51 theCategory(
"FastSimulation|Muons|FastTSGFromPropagation"),
52 theTkLayerMeasurements(), theTracker(), theNavigation(), theService(service), theUpdator(), theEstimator(), theSigmaZ(0.0), theConfig (iConfig),
53 theSimTrackCollectionToken_(iC.consumes<edm::
SimTrackContainer>(theConfig.getParameter<edm::
InputTag>(
"SimTrackCollectionLabel"))),
85 if ( nls.empty() )
return;
89 bool usePredictedState =
false;
92 std::vector<TrajectoryMeasurement> alltm;
94 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin();
95 inl != nls.end(); inl++, ndesLayer++ ) {
96 if ( (*inl == 0) )
break;
99 if ( (!alltm.empty()) ) {
105 if ( alltm.empty() ) {
107 usePredictedState =
true;
111 if ( alltm.size() > 5 ) alltm.erase(alltm.begin() + 5, alltm.end());
114 const std::vector<unsigned> theSimTrackIds =
theGSRecHits->ids();
116 std::vector<TrajectorySeedHitCandidate> outerHits;
119 bool isMatch =
false;
120 for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
127 for(
unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
128 const SimTrack & simtrack = (*simTracks)[theSimTrackIds[tkId]];
140 int charge = (int)simtrack.
charge();
144 unsigned int outerId = 0;
145 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
149 if(
id > outerId ) outerId = id;
152 if(
id > outerId ) outerId = id;
155 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
158 aTrackingRecHit = theSeedHits.
hit()->
clone();
160 if( !recHit )
continue;
164 container.
push_back(recHit->hit()->clone());
173 result.push_back(ts);
182 for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
189 for(
unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
190 const SimTrack & simtrack = (*simTracks)[theSimTrackIds[tkId]];
202 int charge = (int)simtrack.
charge();
206 unsigned int outerId = 0;
207 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
211 if(
id > outerId ) outerId = id;
214 if(
id > outerId ) outerId = id;
217 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
220 aTrackingRecHit = theSeedHits.
hit()->
clone();
222 if( !recHit )
continue;
226 container.
push_back(recHit->hit()->clone());
235 result.push_back(ts);
265 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin();
266 inl != nls.end(); inl++ ) {
268 if ( !result.empty() || *inl == 0 ) {
271 std::vector<DetLayer::DetWithState> compatDets = (*inl)->compatibleDets(staState, *
propagator(), *
estimator());
273 if ( compatDets.empty() )
continue;
275 result.push_back(ts);
297 <<
"Possible choices are: discrete, fixed, matrix.\n"
298 <<
"Use discrete method" <<std::endl;
364 bool trackerGeomChanged =
false;
372 trackerGeomChanged =
true;
384 if ( staMuon.first && staMuon.first->isValid() ) {
386 innerTS = staMuon.first->firstMeasurement().updatedState();
389 innerTS = staMuon.first->lastMeasurement().updatedState();
411 result = fromInside(iniState);
436 std::vector<TrajectoryMeasurement>::iterator tmsend = std::remove_if(tms.begin(), tms.end(),
isInvalid());
437 tms.erase(tmsend, tms.end());
444 std::vector<TrajectoryMeasurement>
result;
447 if ( compatDets.empty() )
return result;
449 for (std::vector<DetLayer::DetWithState>::const_iterator idws = compatDets.begin(); idws != compatDets.end(); ++idws) {
450 if ( idws->second.isValid() && (idws->first) ) {
451 std::vector<TrajectoryMeasurement> tmptm =
458 result.insert(result.end(),tmptm.begin(), tmptm.end());
498 float pt = (staMuon.second)->
pt();
558 float localErrors[15];
560 for (
int i=0;
i<dim; ++
i) {
561 for (
int j=0;
j<=
i; ++
j) {
562 localErrors[k++] =
m(
i,
j);
565 int surfaceSide =
static_cast<int>(ts.
surfaceSide());
std::vector< TrajectoryMeasurement > findMeasurements(const DetLayer *, const TrajectoryStateOnSurface &) const
look for measurements on the first compatible layer
edm::Handle< MeasurementTrackerEvent > theMeasTrackerEvent
edm::ESHandle< MeasurementTracker > theMeasTracker
std::unique_ptr< const TrajectoryStateUpdator > theUpdator
edm::EDGetTokenT< SiTrackerGSMatchedRecHit2DCollection > theHitProducer
void rescaleError(double factor)
const math::XYZVectorD & trackerSurfacePosition() const
T getParameter(std::string const &) const
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
FastTSGFromPropagation(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
constructor
edm::Handle< reco::BeamSpot > theBeamSpot
bool theUseVertexStateFlag
std::pair< const_iterator, const_iterator > range
iterator range
void adjust(FreeTrajectoryState &) const
adjust the error matrix of the FTS
unsigned long long theCacheId_MT
std::pair< const Trajectory *, reco::TrackRef > TrackCand
const LocalTrajectoryParameters & localParameters() const
const LayerMeasurements * tkLayerMeasurements() const
const GlobalTrajectoryParameters & parameters() const
const GSSiTrackerRecHit2DLocalPos * hit() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< edm::SimTrackContainer > theSimTrackCollectionToken_
edm::Handle< edm::SimTrackContainer > theSimTracks
const CurvilinearTrajectoryError & curvilinearError() const
std::string thePropagatorName
virtual ~FastTSGFromPropagation()
destructor
edm::ESHandle< GeometricSearchTracker > theTracker
tuple MeasurementTrackerEvent
GlobalPoint globalPosition() const
void validMeasurements(std::vector< TrajectoryMeasurement > &) const
select valid measurements
const MuonServiceProxy * theService
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
std::string theResetMethod
float charge() const
charge
const Plane & surface() const
The nominal surface of the GeomDet.
const CurvilinearTrajectoryError & curvilinearError() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
const Chi2MeasurementEstimator * estimator() const
uint32_t rawId() const
get the raw id
double theFlexErrorRescaling
void getRescalingFactor(const TrackCand &staMuon)
static const double pts[33]
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerEventToken_
C::const_iterator const_iterator
constant access iterator type
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
const edm::ParameterSet theConfig
const SurfaceType & surface() const
bool passSelection(const TrajectoryStateOnSurface &) const
check some quantity and beam-spot compatibility and decide to continue
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::vector< TrajectoryMeasurement > findMeasurements_new(const DetLayer *, const TrajectoryStateOnSurface &) const
look for measurements on the first compatible layer (faster way)
unsigned int detId() const
TrajectoryStateOnSurface outerTkState(const TrackCand &) const
const AlgebraicSymMatrix55 & matrix() const
static void multiply(CurvilinearTrajectoryError &initial_error, const CurvilinearTrajectoryError &scale_error)
multiply term by term the two matrix
TrajectoryStateOnSurface innerState(const TrackCand &) const
LayerMeasurements theTkLayerMeasurements
const LocalTrajectoryError & localError() const
tuple Chi2MeasurementEstimator
GlobalVector momentum() const
edm::Handle< SiTrackerGSMatchedRecHit2DCollection > theGSRecHits
void rescaleError(double factor)
const TrackerGeometry * theGeometry
void init(const MuonServiceProxy *)
initialize
double zDis(const TrajectoryStateOnSurface &tsos) const
const TrajectoryStateUpdator * updator() const
const GlobalTrajectoryParameters & globalParameters() const
std::unique_ptr< const DirectTrackerNavigation > theNavigation
const math::XYZTLorentzVectorD & trackerSurfaceMomentum() const
edm::ESHandle< Propagator > propagator() const
TrajectorySeed createSeed(const TrajectoryStateOnSurface &, const DetId &) const
create a hitless seed from a trajectory state
void stateOnDet(const TrajectoryStateOnSurface &ts, unsigned int detid, PTrajectoryStateOnDet &pts) const
A mere copy (without memory leak) of an existing tracking method.
virtual GSSiTrackerRecHit2DLocalPos * clone() const =0
ESHandle< TrackerGeometry > geometry
GlobalVector globalMomentum() const
edm::EDGetTokenT< reco::BeamSpot > beamSpot_
static int position[264][3]
double theFixedErrorRescaling
std::unique_ptr< const Chi2MeasurementEstimator > theEstimator
double dxyDis(const TrajectoryStateOnSurface &tsos) const
DetId geographicalId() const
void trackerSeeds(const TrackCand &, const TrackingRegion &, const TrackerTopology *tTopo, std::vector< TrajectorySeed > &)
generate seed(s) for a track
const BasicVectorType & basicVector() const
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
std::vector< SimTrack > SimTrackContainer
void setEvent(const edm::Event &)
set an event
virtual const TrackerGeomDet * idToDet(DetId) const
unsigned long long theCacheId_TG
std::unique_ptr< MuonErrorMatrix > theErrorMatrixAdjuster