49 beamSpot_(iConfig.getParameter<edm::InputTag>(
"beamSpot"))
51 theCategory =
"FastSimulation|Muons||FastTSGFromPropagation";
55 FastTSGFromPropagation::FastTSGFromPropagation(
const edm::ParameterSet & iConfig,
const MuonServiceProxy* service,
edm::ConsumesCollector& iC) : theTkLayerMeasurements(), theTracker(0), theNavigation(0), theService(service),theUpdator(0), theEstimator(0), theSigmaZ(0), theConfig (iConfig),
56 beamSpot_(iConfig.getParameter<edm::InputTag>(
"beamSpot"))
58 theCategory =
"FastSimulation|Muons|FastTSGFromPropagation";
95 if ( nls.empty() )
return;
99 bool usePredictedState =
false;
102 std::vector<TrajectoryMeasurement> alltm;
104 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin();
105 inl != nls.end(); inl++, ndesLayer++ ) {
106 if ( (*inl == 0) )
break;
109 if ( (!alltm.empty()) ) {
115 if ( alltm.empty() ) {
117 usePredictedState =
true;
121 if ( alltm.size() > 5 ) alltm.erase(alltm.begin() + 5, alltm.end());
124 const std::vector<unsigned> theSimTrackIds =
theGSRecHits->ids();
126 std::vector<TrackerRecHit> outerHits;
129 bool isMatch =
false;
130 for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
137 for(
unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
138 const SimTrack & simtrack = (*simTracks)[theSimTrackIds[tkId]];
154 unsigned int outerId = 0;
155 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
159 if(
id > outerId ) outerId = id;
162 if(
id > outerId ) outerId = id;
165 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
168 aTrackingRecHit = theSeedHits.
hit()->
clone();
170 if( !recHit )
continue;
174 container.
push_back(recHit->hit()->clone());
183 result.push_back(ts);
192 for (std::vector<TrajectoryMeasurement>::const_iterator itm = alltm.begin(); itm != alltm.end(); itm++) {
199 for(
unsigned tkId=0; tkId != theSimTrackIds.size(); ++tkId ) {
200 const SimTrack & simtrack = (*simTracks)[theSimTrackIds[tkId]];
216 unsigned int outerId = 0;
217 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
221 if(
id > outerId ) outerId = id;
224 if(
id > outerId ) outerId = id;
227 for( iterRecHit = theRecHitRangeIteratorBegin; iterRecHit != theRecHitRangeIteratorEnd; ++iterRecHit) {
230 aTrackingRecHit = theSeedHits.
hit()->
clone();
232 if( !recHit )
continue;
236 container.
push_back(recHit->hit()->clone());
245 result.push_back(ts);
275 for (std::vector<const DetLayer*>::const_iterator inl = nls.begin();
276 inl != nls.end(); inl++ ) {
278 if ( !result.empty() || *inl == 0 ) {
281 std::vector<DetLayer::DetWithState> compatDets = (*inl)->compatibleDets(staState, *
propagator(), *
estimator());
283 if ( compatDets.empty() )
continue;
285 result.push_back(ts);
307 <<
"Possible choices are: discrete, fixed, matrix.\n"
308 <<
"Use discrete method" <<std::endl;
377 bool trackerGeomChanged =
false;
385 trackerGeomChanged =
true;
398 if ( staMuon.first && staMuon.first->isValid() ) {
400 innerTS = staMuon.first->firstMeasurement().updatedState();
403 innerTS = staMuon.first->lastMeasurement().updatedState();
425 result = fromInside(iniState);
450 std::vector<TrajectoryMeasurement>::iterator tmsend = std::remove_if(tms.begin(), tms.end(),
isInvalid());
451 tms.erase(tmsend, tms.end());
458 std::vector<TrajectoryMeasurement>
result;
461 if ( compatDets.empty() )
return result;
463 for (std::vector<DetLayer::DetWithState>::const_iterator idws = compatDets.begin(); idws != compatDets.end(); ++idws) {
464 if ( idws->second.isValid() && (idws->first) ) {
465 std::vector<TrajectoryMeasurement> tmptm =
472 result.insert(result.end(),tmptm.begin(), tmptm.end());
512 float pt = (staMuon.second)->
pt();
572 float localErrors[15];
574 for (
int i=0;
i<dim; ++
i) {
575 for (
int j=0;
j<=
i; ++
j) {
576 localErrors[k++] =
m(
i,
j);
579 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
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
const Chi2MeasurementEstimator * theEstimator
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
edm::Handle< edm::SimTrackContainer > theSimTracks
const DirectTrackerNavigation * theNavigation
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TransientTrackingRecHit &) const =0
const CurvilinearTrajectoryError & curvilinearError() const
std::string thePropagatorName
virtual ~FastTSGFromPropagation()
destructor
virtual RecHit2DLocalPos * clone() const =0
edm::ESHandle< GeometricSearchTracker > theTracker
GlobalPoint globalPosition() const
void validMeasurements(std::vector< TrajectoryMeasurement > &) const
select valid measurements
CurvilinearTrajectoryError get(GlobalVector momentum, bool convolute=true)
main method to be used. Retrieve a 5x5 symetrical matrix according to parametrization of error or sca...
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
static int position[TOTALCHAMBERS][3]
const Chi2MeasurementEstimator * estimator() const
edm::InputTag theHitProducer
uint32_t rawId() const
get the raw id
double theFlexErrorRescaling
void getRescalingFactor(const TrackCand &staMuon)
edm::ParameterSet theConfig
static const double pts[33]
C::const_iterator const_iterator
constant access iterator type
const SurfaceType & surface() const
edm::InputTag theMeasurementTrackerEventTag
bool passSelection(const TrajectoryStateOnSurface &) const
check some quantity and beam-spot compatibility and decide to continue
const TrajectoryStateUpdator * theUpdator
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
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
GlobalVector momentum() const
MuonErrorMatrix * theErrorMatrixAdjuster
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
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.
const GSSiTrackerRecHit2DLocalPos * hit() const
edm::InputTag theSimTrackCollectionLabel
ESHandle< TrackerGeometry > geometry
GlobalVector globalMomentum() const
double theFixedErrorRescaling
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
find compatible layers for a given trajectory state
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
unsigned long long theCacheId_TG