CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TSGForRoadSearch Class Reference

#include <TSGForRoadSearch.h>

Inheritance diagram for TSGForRoadSearch:
TrackerSeedGenerator

Public Types

typedef std::vector< TrajectorySeedBTSeedCollection
 
typedef std::pair< const Trajectory *, reco::TrackRefTrackCand
 
- Public Types inherited from TrackerSeedGenerator
typedef std::vector< TrajectorySeedBTSeedCollection
 
typedef std::pair< const Trajectory *, reco::TrackRefTrackCand
 

Public Member Functions

void init (const MuonServiceProxy *service) override
 initialize the service More...
 
void setEvent (const edm::Event &event) override
 set the event: update the MeasurementTracker More...
 
void trackerSeeds (const TrackCand &, const TrackingRegion &, const TrackerTopology *, BTSeedCollection &) override
 generated seed(s) for a track. the tracking region is not used. More...
 
 TSGForRoadSearch (const edm::ParameterSet &pset, edm::ConsumesCollector &IC)
 
 ~TSGForRoadSearch () override
 
- Public Member Functions inherited from TrackerSeedGenerator
const edm::EventgetEvent () const
 
 TrackerSeedGenerator ()
 
virtual ~TrackerSeedGenerator ()
 destructor More...
 

Private Member Functions

bool IPfts (const reco::Track &, FreeTrajectoryState &)
 get the FTS for a Track: adjusting the error matrix if requested More...
 
void makeSeeds_0 (const reco::Track &, std::vector< TrajectorySeed > &)
 oseed from inside-out: innermost Strip layer More...
 
void makeSeeds_1 (const reco::Track &, std::vector< TrajectorySeed > &)
 not implemented More...
 
void makeSeeds_2 (const reco::Track &, std::vector< TrajectorySeed > &)
 not implemented More...
 
void makeSeeds_3 (const reco::Track &, std::vector< TrajectorySeed > &)
 outside-in: outermost Strip layer More...
 
void makeSeeds_4 (const reco::Track &, std::vector< TrajectorySeed > &)
 inside-out: innermost Pixel/Strip layer More...
 
bool notAtIPtsos (TrajectoryStateOnSurface &state)
 make the adjustement away from PCA state if requested More...
 
void pushTrajectorySeed (const reco::Track &muon, std::vector< DetLayer::DetWithState > &compatible, PropagationDirection direction, std::vector< TrajectorySeed > &result) const
 add the seed(s) to the collection of seeds More...
 

Private Attributes

bool theAdjustAtIp
 adjust the state at IP or where it is defined for the seed More...
 
std::string theCategory
 
Chi2MeasurementEstimatortheChi2Estimator
 
edm::ParameterSet theConfig
 
bool theCopyMuonRecHit
 
MuonErrorMatrixtheErrorMatrixAdjuster
 
edm::ESHandle< GeometricSearchTrackertheGeometricSearchTracker
 
bool theManySeeds
 
edm::ESHandle< MeasurementTrackertheMeasurementTracker
 
const MeasurementTrackerEventtheMeasurementTrackerEvent
 
edm::InputTag theMeasurementTrackerEventTag
 
edm::EDGetTokenT< MeasurementTrackerEventtheMeasurementTrackerEventToken
 
unsigned int theOption
 
edm::ESHandle< PropagatortheProp
 
std::string thePropagatorCompatibleName
 
std::string thePropagatorName
 
edm::ESHandle< PropagatorthePropCompatible
 
const MuonServiceProxytheProxyService
 
TrajectoryStateUpdatortheUpdator
 

Additional Inherited Members

- Protected Attributes inherited from TrackerSeedGenerator
const edm::EventtheEvent
 
const MuonServiceProxytheProxyService
 

Detailed Description

Description: this class generates hit-less TrajectorySeed from a given Track. the original error matrix of the Track is adjusted (configurable). this class is principally used for muon HLT. for options are available:

regular operation is one seed per track, but optionnaly, more than one seed can be madefor one track.

Author
Jean-Roch Vlimant

Definition at line 45 of file TSGForRoadSearch.h.

Member Typedef Documentation

◆ BTSeedCollection

Definition at line 47 of file TSGForRoadSearch.h.

◆ TrackCand

Definition at line 48 of file TSGForRoadSearch.h.

Constructor & Destructor Documentation

◆ TSGForRoadSearch()

TSGForRoadSearch::TSGForRoadSearch ( const edm::ParameterSet pset,
edm::ConsumesCollector IC 
)

Definition at line 28 of file TSGForRoadSearch.cc.

28  {
29  theOption = par.getParameter<unsigned int>("option");
30  theCopyMuonRecHit = par.getParameter<bool>("copyMuonRecHit");
31 
32  double Chi2 = par.getParameter<double>("maxChi2");
34 
35  thePropagatorName = par.getParameter<std::string>("propagatorName");
36  thePropagatorCompatibleName = par.getParameter<std::string>("propagatorCompatibleName");
37 
38  theCategory = "TSGForRoadSearch|TrackerSeedGenerator";
39 
40  theManySeeds = par.getParameter<bool>("manySeeds");
41  if (theManySeeds) {
42  theUpdator = new KFUpdator();
43  } else {
44  theUpdator = nullptr;
45  }
46 
47  edm::ParameterSet errorMatrixPset = par.getParameter<edm::ParameterSet>("errorMatrixPset");
48  if (!errorMatrixPset.empty()) {
49  theAdjustAtIp = errorMatrixPset.getParameter<bool>("atIP");
51  } else {
52  theAdjustAtIp = false;
53  theErrorMatrixAdjuster = nullptr;
54  }
55 
56  theMeasurementTrackerEventTag = par.getParameter<edm::InputTag>("MeasurementTrackerEvent");
58 
60 }

References Chi2MeasurementEstimator_cfi::Chi2MeasurementEstimator, edm::ConsumesCollector::consumes(), HLT_2018_cff::errorMatrixPset, edm::ParameterSet::getParameter(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, theAdjustAtIp, theCategory, theChi2Estimator, theCopyMuonRecHit, theErrorMatrixAdjuster, theManySeeds, theMeasurementTrackerEvent, theMeasurementTrackerEventTag, theMeasurementTrackerEventToken, theOption, thePropagatorCompatibleName, thePropagatorName, and theUpdator.

◆ ~TSGForRoadSearch()

TSGForRoadSearch::~TSGForRoadSearch ( )
override

Definition at line 62 of file TSGForRoadSearch.cc.

62  {
63  delete theChi2Estimator;
64  if (theUpdator)
65  delete theUpdator;
68 }

References theChi2Estimator, theErrorMatrixAdjuster, and theUpdator.

Member Function Documentation

◆ init()

void TSGForRoadSearch::init ( const MuonServiceProxy service)
overridevirtual

initialize the service

Reimplemented from TrackerSeedGenerator.

Definition at line 70 of file TSGForRoadSearch.cc.

References theProxyService.

◆ IPfts()

bool TSGForRoadSearch::IPfts ( const reco::Track muon,
FreeTrajectoryState fts 
)
private

get the FTS for a Track: adjusting the error matrix if requested

Definition at line 119 of file TSGForRoadSearch.cc.

119  {
121  LogDebug(theCategory) << "pure L2 state: " << fts;
122  if (fts.position().mag() == 0 && fts.momentum().mag() == 0) {
123  edm::LogError(theCategory) << "initial state of muon is (0,0,0)(0,0,0). no seed.";
124  return false;
125  }
126 
127  //rescale the error at IP
130  LogDebug(theCategory) << "after adjusting the error matrix: " << fts;
131  }
132 
133  return true;
134 }

References MuonErrorMatrix::adjust(), trajectoryStateTransform::initialFreeState(), LogDebug, MuonServiceProxy::magneticField(), theAdjustAtIp, theCategory, theErrorMatrixAdjuster, and theProxyService.

Referenced by makeSeeds_0(), makeSeeds_3(), and makeSeeds_4().

◆ makeSeeds_0()

void TSGForRoadSearch::makeSeeds_0 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
)
private

oseed from inside-out: innermost Strip layer

Definition at line 139 of file TSGForRoadSearch.cc.

139  {
140  //get the state at IP
141  FreeTrajectoryState cIPFTS;
142  if (!IPfts(muon, cIPFTS))
143  return;
144 
145  //take state at inner surface and check the first part reached
146  const std::vector<const BarrelDetLayer *> &blc = theGeometricSearchTracker->tibLayers();
148  theProxyService->propagator(thePropagatorName)->propagate(cIPFTS, blc.front()->surface());
149  if (!inner.isValid()) {
150  LogDebug(theCategory) << "inner state is not valid. no seed.";
151  return;
152  }
153 
154  //rescale the error
155  if (!notAtIPtsos(inner))
156  return;
157 
158  double z = inner.globalPosition().z();
159 
160  const std::vector<const ForwardDetLayer *> &ptidc = theGeometricSearchTracker->posTidLayers();
161  const std::vector<const ForwardDetLayer *> &ptecc = theGeometricSearchTracker->posTecLayers();
162  const std::vector<const ForwardDetLayer *> &ntidc = theGeometricSearchTracker->negTidLayers();
163  const std::vector<const ForwardDetLayer *> &ntecc = theGeometricSearchTracker->negTecLayers();
164 
165  const DetLayer *inLayer = nullptr;
166  if (fabs(z) < ptidc.front()->surface().position().z()) {
167  inLayer = blc.front();
168  } else if (fabs(z) < ptecc.front()->surface().position().z()) {
169  inLayer = (z < 0) ? ntidc.front() : ptidc.front();
170  } else {
171  inLayer = (z < 0) ? ntecc.front() : ptecc.front();
172  }
173 
174  //find out at least one compatible detector reached
175  std::vector<DetLayer::DetWithState> compatible;
176  compatible.reserve(10);
177  inLayer->compatibleDetsV(
179 
180  //loop the parts until at least a compatible is found
181  while (compatible.empty()) {
182  switch (GeomDetEnumerators::subDetGeom[inLayer->subDetector()]) {
187  LogDebug(theCategory) << "from inside-out, trying TEC or TOB layers. no seed.";
188  return;
189  break;
191  inLayer = (z < 0) ? ntidc.front() : ptidc.front();
192  break;
194  inLayer = (z < 0) ? ntecc.front() : ptecc.front();
195  break;
196  default:
197  LogDebug(theCategory) << "subdetectorid is not a tracker sub-dectector id. skipping.";
198  return;
199  }
200  inLayer->compatibleDetsV(
202  }
203 
205 
206  return;
207 }

References alongMomentum, GeometricSearchDet::compatibleDetsV(), SurfaceOrientation::inner, IPfts(), LogDebug, GeometricSearchTracker::negTecLayers(), GeometricSearchTracker::negTidLayers(), notAtIPtsos(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GeometricSearchTracker::posTecLayers(), GeometricSearchTracker::posTidLayers(), Propagator::propagate(), MuonServiceProxy::propagator(), pushTrajectorySeed(), mps_fire::result, DetLayer::subDetector(), GeomDetEnumerators::subDetGeom, GeomDetEnumerators::TEC, theCategory, theChi2Estimator, theGeometricSearchTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, GeomDetEnumerators::TIB, GeometricSearchTracker::tibLayers(), GeomDetEnumerators::TID, GeomDetEnumerators::TOB, and z.

Referenced by makeSeeds_4(), and trackerSeeds().

◆ makeSeeds_1()

void TSGForRoadSearch::makeSeeds_1 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
)
private

not implemented

Definition at line 209 of file TSGForRoadSearch.cc.

209  {
210  edm::LogError(theCategory) << "option 1 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
211  return;
212 }

References theCategory.

Referenced by trackerSeeds().

◆ makeSeeds_2()

void TSGForRoadSearch::makeSeeds_2 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
)
private

not implemented

Definition at line 214 of file TSGForRoadSearch.cc.

214  {
215  edm::LogError(theCategory) << "option 2 of TSGForRoadSearch is not implemented yet. Please use 0,3 or 4. no seed.";
216  return;
217 }

References theCategory.

Referenced by trackerSeeds().

◆ makeSeeds_3()

void TSGForRoadSearch::makeSeeds_3 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
)
private

outside-in: outermost Strip layer

Definition at line 222 of file TSGForRoadSearch.cc.

222  {
223  //get the state at IP
224  FreeTrajectoryState cIPFTS;
225  if (!IPfts(muon, cIPFTS))
226  return;
227 
228  //take state at outer surface and check the first part reached
229  const std::vector<const BarrelDetLayer *> &blc = theGeometricSearchTracker->tobLayers();
230 
231  // TrajectoryStateOnSurface outer = theProxyService->propagator(thePropagatorName)->propagate(cIPFTS,blc.back()->surface());
233  TrajectoryStateOnSurface outer = onBounds(cIPFTS);
234 
235  if (!outer.isValid()) {
236  LogDebug(theCategory) << "outer state is not valid. no seed.";
237  return;
238  }
239 
240  //rescale the error
241  if (!notAtIPtsos(outer))
242  return;
243 
244  double z = outer.globalPosition().z();
245 
246  const std::vector<const ForwardDetLayer *> &ptecc = theGeometricSearchTracker->posTecLayers();
247  const std::vector<const ForwardDetLayer *> &ntecc = theGeometricSearchTracker->negTecLayers();
248 
249  LogDebug(theCategory) << "starting looking for a compatible layer from: " << outer << "\nz: " << z
250  << "TEC1 z: " << ptecc.front()->surface().position().z();
251 
252  unsigned int layerShift = 0;
253  const DetLayer *inLayer = nullptr;
254  if (fabs(z) < ptecc.front()->surface().position().z()) {
255  inLayer = *(blc.rbegin() + layerShift);
256  LogTrace(theCategory) << "choosing TOB layer with shift: " << layerShift;
257  } else {
258  unsigned int tecIt = 1;
259  for (; tecIt != ptecc.size(); tecIt++) {
260  LogTrace(theCategory) << "checking surface with shift: " << tecIt
261  << "z: " << ptecc[tecIt]->surface().position().z();
262  if (fabs(z) < ptecc[tecIt]->surface().position().z()) {
263  inLayer = (z < 0) ? ntecc[tecIt - 1] : ptecc[tecIt - 1];
264  layerShift = tecIt - 1;
265  LogTrace(theCategory) << "choosing TEC layer with shift: " << layerShift
266  << " and z: " << inLayer->surface().position().z();
267  break;
268  }
269  }
270  if (!inLayer) {
271  inLayer = (z < 0) ? ntecc.back() : ptecc.back();
272  LogTrace(theCategory) << "choosing last TEC layer with z: " << inLayer->surface().position().z();
273  }
274  }
275 
276  //find out at least one compatible detector reached
277  std::vector<DetLayer::DetWithState> compatible;
278  compatible.reserve(10);
279  inLayer->compatibleDetsV(
281 
282  //loop the parts until at least a compatible is found
283  while (compatible.empty()) {
284  switch (GeomDetEnumerators::subDetGeom[inLayer->subDetector()]) {
290  layerShift++;
291  if (layerShift >= blc.size()) {
292  LogDebug(theCategory) << "all barrel layers are exhausted to find starting state. no seed,";
293  return;
294  }
295  inLayer = *(blc.rbegin() + layerShift);
296  break;
298  if (layerShift == 0) {
299  LogDebug(theCategory) << "failed to get a compatible module on a TEC layer, using the last TOB layer.";
300  inLayer = *(blc.rbegin() + layerShift);
301  } else {
302  layerShift--;
303  LogDebug(theCategory) << "reaching more in with layer " << layerShift << " in TEC";
304  inLayer = (z < 0) ? ntecc[layerShift] : ptecc[layerShift];
305  }
306  break;
307  default:
308  edm::LogError(theCategory) << "subdetectorid is not a tracker sub-dectector id. skipping.";
309  return;
310  }
311  inLayer->compatibleDetsV(
313  }
314 
316 
317  return;
318 }

References GeometricSearchDet::compatibleDetsV(), IPfts(), LogDebug, LogTrace, GeometricSearchTracker::negTecLayers(), notAtIPtsos(), oppositeToMomentum, SurfaceOrientation::outer, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GloballyPositioned< T >::position(), position, GeometricSearchTracker::posTecLayers(), edm::ESHandle< T >::product(), MuonServiceProxy::propagator(), pushTrajectorySeed(), mps_fire::result, DetLayer::subDetector(), GeomDetEnumerators::subDetGeom, GeometricSearchDet::surface(), GeomDetEnumerators::TEC, theCategory, theChi2Estimator, theGeometricSearchTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, GeomDetEnumerators::TOB, GeometricSearchTracker::tobLayers(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by trackerSeeds().

◆ makeSeeds_4()

void TSGForRoadSearch::makeSeeds_4 ( const reco::Track muon,
std::vector< TrajectorySeed > &  result 
)
private

inside-out: innermost Pixel/Strip layer

Definition at line 323 of file TSGForRoadSearch.cc.

323  {
324  //get the state at IP
325  FreeTrajectoryState cIPFTS;
326  if (!IPfts(muon, cIPFTS))
327  return;
328 
329  //take state at inner surface and check the first part reached
330  const std::vector<const BarrelDetLayer *> &blc = theGeometricSearchTracker->pixelBarrelLayers();
331  if (blc.empty()) {
332  edm::LogError(theCategory) << "want to start from pixel layer, but no barrel exists. trying without pixel.";
334  return;
335  }
336 
338  theProxyService->propagator(thePropagatorName)->propagate(cIPFTS, blc.front()->surface());
339  if (!inner.isValid()) {
340  LogDebug(theCategory) << "inner state is not valid. no seed.";
341  return;
342  }
343 
344  //rescale the error
345  if (!notAtIPtsos(inner))
346  return;
347 
348  double z = inner.globalPosition().z();
349 
350  const std::vector<const ForwardDetLayer *> &ppxlc = theGeometricSearchTracker->posPixelForwardLayers();
351  const std::vector<const ForwardDetLayer *> &npxlc = theGeometricSearchTracker->negPixelForwardLayers();
352  const std::vector<const ForwardDetLayer *> &ptidc = theGeometricSearchTracker->posTidLayers();
353  const std::vector<const ForwardDetLayer *> &ptecc = theGeometricSearchTracker->posTecLayers();
354  const std::vector<const ForwardDetLayer *> &ntidc = theGeometricSearchTracker->negTidLayers();
355  const std::vector<const ForwardDetLayer *> &ntecc = theGeometricSearchTracker->negTecLayers();
356 
357  if ((ppxlc.empty() || npxlc.empty()) && (ptidc.empty() || ptecc.empty())) {
358  edm::LogError(theCategory) << "want to start from pixel layer, but no forward layer exists. trying without pixel.";
360  return;
361  }
362 
363  const DetLayer *inLayer = nullptr;
364  std::vector<const ForwardDetLayer *>::const_iterator layerIt;
365 
366  double fz = fabs(z);
367 
368  //simple way of finding a first layer to try out
369  if (fz < fabs(((z > 0) ? ppxlc : npxlc).front()->surface().position().z())) {
370  inLayer = blc.front();
371  } else if (fz < fabs(((z > 0) ? ppxlc : npxlc).back()->surface().position().z())) {
372  layerIt = ((z > 0) ? ppxlc : npxlc).begin();
373  inLayer = *layerIt;
374  } else if (fz < fabs(((z > 0) ? ptidc : ntidc).front()->surface().position().z())) {
375  layerIt = ((z > 0) ? ppxlc : npxlc).end() - 1;
376  inLayer = *layerIt;
377  } else if (fz < fabs(((z > 0) ? ptecc : ntecc).front()->surface().position().z())) {
378  layerIt = ((z > 0) ? ptidc : ntidc).begin();
379  inLayer = *layerIt;
380  } else if (fz < fabs(((z > 0) ? ptecc : ntecc).back()->surface().position().z())) {
381  layerIt = ((z > 0) ? ptecc : ntecc).begin();
382  inLayer = *layerIt;
383  } else {
384  edm::LogWarning(theCategory) << "the state is not consistent with any tracker layer:\n" << inner;
385  return;
386  }
387 
388  //find out at least one compatible detector reached
389  std::vector<DetLayer::DetWithState> compatible;
390  compatible.reserve(10);
391  inLayer->compatibleDetsV(
393 
394  //if none were found. you should do something more.
395  if (compatible.empty()) {
396  std::vector<const ForwardDetLayer *>::const_iterator pxlEnd = (z > 0) ? ppxlc.end() : npxlc.end();
397  std::vector<const ForwardDetLayer *>::const_iterator tidEnd = (z > 0) ? ptidc.end() : ntidc.end();
398  std::vector<const ForwardDetLayer *>::const_iterator tecEnd = (z > 0) ? ptecc.end() : ntecc.end();
399  std::vector<const ForwardDetLayer *>::const_iterator pxlBegin = (z > 0) ? ppxlc.begin() : npxlc.begin();
400  std::vector<const ForwardDetLayer *>::const_iterator tidBegin = (z > 0) ? ptidc.begin() : ntidc.begin();
401  std::vector<const ForwardDetLayer *>::const_iterator tecBegin = (z > 0) ? ptecc.begin() : ntecc.begin();
402 
403  //go to first disk if not already in a disk situation
404  if (!dynamic_cast<const ForwardDetLayer *>(inLayer))
405  layerIt = pxlBegin--;
406 
407  while (compatible.empty()) {
408  switch (GeomDetEnumerators::subDetGeom[(*layerIt)->subDetector()]) {
410  layerIt++;
411  //if end of list reached. go to the first TID
412  if (layerIt == pxlEnd)
413  layerIt = tidBegin;
414  break;
415  }
417  layerIt++;
418  //if end of list reached. go to the first TEC
419  if (layerIt == tidEnd)
420  layerIt = tecBegin;
421  break;
422  }
424  layerIt++;
425  if (layerIt == tecEnd) {
426  edm::LogWarning(theCategory) << "ran out of layers to find a seed: no seed.";
427  return;
428  }
429  break;
430  }
433  << "this should not happen... ever. Please report. GeomDetEnumerators::PixelBarrel. no seed.";
434  return;
435  }
438  << "this should not happen... ever. Please report. GeomDetEnumerators::TIB. no seed.";
439  return;
440  }
443  << "this should not happen... ever. Please report. GeomDetEnumerators::TOB. no seed.";
444  return;
445  }
446  default: {
447  edm::LogError(theCategory) << "Subdetector id is not a tracker sub-detector id. no seed.";
448  return;
449  }
450  } //switch
451 
452  (*layerIt)->compatibleDetsV(
454  } //while
455  } //if size==0
456 
458 
459  return;
460 }

References alongMomentum, GeometricSearchDet::compatibleDetsV(), SurfaceOrientation::inner, IPfts(), LogDebug, makeSeeds_0(), GeometricSearchTracker::negPixelForwardLayers(), GeometricSearchTracker::negTecLayers(), GeometricSearchTracker::negTidLayers(), notAtIPtsos(), GeomDetEnumerators::PixelBarrel, GeometricSearchTracker::pixelBarrelLayers(), GeomDetEnumerators::PixelEndcap, position, GeometricSearchTracker::posPixelForwardLayers(), GeometricSearchTracker::posTecLayers(), GeometricSearchTracker::posTidLayers(), Propagator::propagate(), MuonServiceProxy::propagator(), pushTrajectorySeed(), mps_fire::result, GeomDetEnumerators::subDetGeom, GeomDetEnumerators::TEC, theCategory, theChi2Estimator, theGeometricSearchTracker, thePropagatorCompatibleName, thePropagatorName, theProxyService, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, GeomDetEnumerators::TOB, and z.

Referenced by trackerSeeds().

◆ notAtIPtsos()

bool TSGForRoadSearch::notAtIPtsos ( TrajectoryStateOnSurface state)
private

make the adjustement away from PCA state if requested

Definition at line 110 of file TSGForRoadSearch.cc.

110  {
111  LogDebug(theCategory) << "outer state: " << state;
114  LogDebug(theCategory) << "outer state after rescale: " << state;
115  }
116  return true;
117 }

References MuonErrorMatrix::adjust(), LogDebug, theAdjustAtIp, theCategory, and theErrorMatrixAdjuster.

Referenced by makeSeeds_0(), makeSeeds_3(), and makeSeeds_4().

◆ pushTrajectorySeed()

void TSGForRoadSearch::pushTrajectorySeed ( const reco::Track muon,
std::vector< DetLayer::DetWithState > &  compatible,
PropagationDirection  direction,
std::vector< TrajectorySeed > &  result 
) const
private

add the seed(s) to the collection of seeds

Definition at line 465 of file TSGForRoadSearch.cc.

468  {
469  if (compatible.empty()) {
470  LogDebug(theCategory) << "pushTrajectorySeed with no compatible module. 0 seed.";
471  return;
472  }
473 
474  if (theManySeeds) {
475  //finf out every compatible measurements
476  for (std::vector<DetLayer::DetWithState>::iterator DWSit = compatible.begin(); DWSit != compatible.end(); ++DWSit) {
477  bool aBareTS = false;
478  const GeomDet *gd = DWSit->first;
479  if (!gd) {
480  edm::LogError(theCategory) << "GeomDet is not valid.";
481  continue;
482  }
484  std::vector<TrajectoryMeasurement> tmp = md.fastMeasurements(
485  DWSit->second, DWSit->second, *theProxyService->propagator(thePropagatorCompatibleName), *theChi2Estimator);
486  //make a trajectory seed for each of them
487 
488  for (std::vector<TrajectoryMeasurement>::iterator Mit = tmp.begin(); Mit != tmp.end(); ++Mit) {
489  TrajectoryStateOnSurface predState(Mit->predictedState());
492  if (theCopyMuonRecHit) {
493  LogDebug(theCategory) << "copying (" << muon.recHitsSize() << ") muon recHits";
494  //copy the muon rechit into the seed
495  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit != muon.recHitsEnd(); trit++) {
496  rhContainer.push_back((*trit)->clone());
497  }
498  }
499 
500  if (hit->isValid()) {
501  TrajectoryStateOnSurface upState(theUpdator->update(predState, *hit));
502 
503  PTrajectoryStateOnDet const &PTSOD =
505  LogDebug(theCategory) << "state used to build a trajectory seed: \n"
506  << upState << "on detector: " << gd->geographicalId().rawId();
507  //add the tracking rechit
508  if (theCopyMuonRecHit) {
509  edm::LogError(theCategory) << "not a bare seed and muon hits are copied. dumping the muon hits.";
510  rhContainer.clear();
511  }
512  rhContainer.push_back(hit->hit()->clone());
513 
514  result.push_back(TrajectorySeed(PTSOD, rhContainer, direction));
515  } else {
516  //rec hit is not valid. put a bare TrajectorySeed, only once !
517  if (!aBareTS) {
518  aBareTS = true;
519 
520  PTrajectoryStateOnDet const &PTSOD =
522  LogDebug(theCategory) << "state used to build a bare trajectory seed: \n"
523  << predState << "on detector: " << gd->geographicalId().rawId();
524 
525  result.push_back(TrajectorySeed(PTSOD, rhContainer, direction));
526  }
527  }
528  }
529  }
530  } else {
531  //transform it into a PTrajectoryStateOnDet
532 
534  compatible.front().second, compatible.front().first->geographicalId().rawId());
535  LogDebug(theCategory) << "state used to build a bare trajectory seed: \n"
536  << compatible.front().second
537  << "on detector: " << compatible.front().first->geographicalId().rawId();
538 
540  if (theCopyMuonRecHit) {
541  LogDebug(theCategory) << "copying (" << muon.recHitsSize() << ") muon recHits";
542  //copy the muon rechit into the seed
543  for (trackingRecHit_iterator trit = muon.recHitsBegin(); trit != muon.recHitsEnd(); trit++) {
544  rhContainer.push_back((*trit)->clone());
545  }
546  }
547 
548  //add this seed to the list and return it
549  result.push_back(TrajectorySeed(PTSOD, rhContainer, direction));
550  }
551  return;
552 }

References edm::OwnVector< T, P >::clear(), MeasurementDetWithData::fastMeasurements(), GeomDet::geographicalId(), MeasurementTrackerEvent::idToDet(), LogDebug, trajectoryStateTransform::persistentState(), MuonServiceProxy::propagator(), edm::OwnVector< T, P >::push_back(), DetId::rawId(), mps_fire::result, theCategory, theChi2Estimator, theCopyMuonRecHit, theManySeeds, theMeasurementTrackerEvent, thePropagatorCompatibleName, theProxyService, theUpdator, createJobs::tmp, and TrajectoryStateUpdator::update().

Referenced by makeSeeds_0(), makeSeeds_3(), and makeSeeds_4().

◆ setEvent()

void TSGForRoadSearch::setEvent ( const edm::Event event)
overridevirtual

◆ trackerSeeds()

void TSGForRoadSearch::trackerSeeds ( const TrackCand ,
const TrackingRegion ,
const TrackerTopology ,
BTSeedCollection  
)
overridevirtual

generated seed(s) for a track. the tracking region is not used.

Reimplemented from TrackerSeedGenerator.

Definition at line 87 of file TSGForRoadSearch.cc.

90  {
91  switch (theOption) {
92  case 0:
93  makeSeeds_0(*muonTrackCand.second, result);
94  break;
95  case 1:
96  makeSeeds_1(*muonTrackCand.second, result);
97  break;
98  case 2:
99  makeSeeds_2(*muonTrackCand.second, result);
100  break;
101  case 3:
102  makeSeeds_3(*muonTrackCand.second, result);
103  break;
104  case 4:
105  makeSeeds_4(*muonTrackCand.second, result);
106  break;
107  }
108 }

References makeSeeds_0(), makeSeeds_1(), makeSeeds_2(), makeSeeds_3(), makeSeeds_4(), mps_fire::result, and theOption.

Member Data Documentation

◆ theAdjustAtIp

bool TSGForRoadSearch::theAdjustAtIp
private

adjust the state at IP or where it is defined for the seed

Definition at line 82 of file TSGForRoadSearch.h.

Referenced by IPfts(), notAtIPtsos(), and TSGForRoadSearch().

◆ theCategory

std::string TSGForRoadSearch::theCategory
private

◆ theChi2Estimator

Chi2MeasurementEstimator* TSGForRoadSearch::theChi2Estimator
private

◆ theConfig

edm::ParameterSet TSGForRoadSearch::theConfig
private

Definition at line 89 of file TSGForRoadSearch.h.

◆ theCopyMuonRecHit

bool TSGForRoadSearch::theCopyMuonRecHit
private

Definition at line 102 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), and TSGForRoadSearch().

◆ theErrorMatrixAdjuster

MuonErrorMatrix* TSGForRoadSearch::theErrorMatrixAdjuster
private

Definition at line 111 of file TSGForRoadSearch.h.

Referenced by IPfts(), notAtIPtsos(), TSGForRoadSearch(), and ~TSGForRoadSearch().

◆ theGeometricSearchTracker

edm::ESHandle<GeometricSearchTracker> TSGForRoadSearch::theGeometricSearchTracker
private

Definition at line 92 of file TSGForRoadSearch.h.

Referenced by makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), and setEvent().

◆ theManySeeds

bool TSGForRoadSearch::theManySeeds
private

Definition at line 103 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), setEvent(), and TSGForRoadSearch().

◆ theMeasurementTracker

edm::ESHandle<MeasurementTracker> TSGForRoadSearch::theMeasurementTracker
private

Definition at line 91 of file TSGForRoadSearch.h.

Referenced by setEvent().

◆ theMeasurementTrackerEvent

const MeasurementTrackerEvent* TSGForRoadSearch::theMeasurementTrackerEvent
private

Definition at line 96 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), setEvent(), and TSGForRoadSearch().

◆ theMeasurementTrackerEventTag

edm::InputTag TSGForRoadSearch::theMeasurementTrackerEventTag
private

Definition at line 94 of file TSGForRoadSearch.h.

Referenced by TSGForRoadSearch().

◆ theMeasurementTrackerEventToken

edm::EDGetTokenT<MeasurementTrackerEvent> TSGForRoadSearch::theMeasurementTrackerEventToken
private

Definition at line 95 of file TSGForRoadSearch.h.

Referenced by setEvent(), and TSGForRoadSearch().

◆ theOption

unsigned int TSGForRoadSearch::theOption
private

Definition at line 101 of file TSGForRoadSearch.h.

Referenced by trackerSeeds(), and TSGForRoadSearch().

◆ theProp

edm::ESHandle<Propagator> TSGForRoadSearch::theProp
private

Definition at line 105 of file TSGForRoadSearch.h.

◆ thePropagatorCompatibleName

std::string TSGForRoadSearch::thePropagatorCompatibleName
private

◆ thePropagatorName

std::string TSGForRoadSearch::thePropagatorName
private

Definition at line 104 of file TSGForRoadSearch.h.

Referenced by makeSeeds_0(), makeSeeds_3(), makeSeeds_4(), and TSGForRoadSearch().

◆ thePropCompatible

edm::ESHandle<Propagator> TSGForRoadSearch::thePropCompatible
private

Definition at line 107 of file TSGForRoadSearch.h.

◆ theProxyService

const MuonServiceProxy* TSGForRoadSearch::theProxyService
private

◆ theUpdator

TrajectoryStateUpdator* TSGForRoadSearch::theUpdator
private

Definition at line 98 of file TSGForRoadSearch.h.

Referenced by pushTrajectorySeed(), TSGForRoadSearch(), and ~TSGForRoadSearch().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TSGForRoadSearch::theOption
unsigned int theOption
Definition: TSGForRoadSearch.h:101
TSGForRoadSearch::makeSeeds_4
void makeSeeds_4(const reco::Track &, std::vector< TrajectorySeed > &)
inside-out: innermost Pixel/Strip layer
Definition: TSGForRoadSearch.cc:323
service
Definition: service.py:1
MeasurementDetWithData::fastMeasurements
std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &tsos2, const Propagator &prop, const MeasurementEstimator &est) const
Definition: MeasurementDetWithData.h:46
GeometricSearchTracker::tobLayers
std::vector< BarrelDetLayer const * > const & tobLayers() const
Definition: GeometricSearchTracker.h:39
GeomDet
Definition: GeomDet.h:27
GeomDetEnumerators::TID
Definition: GeomDetEnumerators.h:15
trajectoryStateTransform::initialFreeState
FreeTrajectoryState initialFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:58
GeometricSearchTracker::tibLayers
std::vector< BarrelDetLayer const * > const & tibLayers() const
Definition: GeometricSearchTracker.h:38
DetLayer::subDetector
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel,...
DetLayer
Definition: DetLayer.h:21
muon
Definition: MuonCocktails.h:17
TSGForRoadSearch::notAtIPtsos
bool notAtIPtsos(TrajectoryStateOnSurface &state)
make the adjustement away from PCA state if requested
Definition: TSGForRoadSearch.cc:110
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
GeomDetEnumerators::TIB
Definition: GeomDetEnumerators.h:13
TSGForRoadSearch::theMeasurementTracker
edm::ESHandle< MeasurementTracker > theMeasurementTracker
Definition: TSGForRoadSearch.h:91
oppositeToMomentum
Definition: PropagationDirection.h:4
GeomDetEnumerators::TOB
Definition: GeomDetEnumerators.h:14
TSGForRoadSearch::makeSeeds_2
void makeSeeds_2(const reco::Track &, std::vector< TrajectorySeed > &)
not implemented
Definition: TSGForRoadSearch.cc:214
TrackerRecoGeometryRecord
Definition: TrackerRecoGeometryRecord.h:11
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::Handle< MeasurementTrackerEvent >
TSGForRoadSearch::theAdjustAtIp
bool theAdjustAtIp
adjust the state at IP or where it is defined for the seed
Definition: TSGForRoadSearch.h:82
TSGForRoadSearch::makeSeeds_1
void makeSeeds_1(const reco::Track &, std::vector< TrajectorySeed > &)
not implemented
Definition: TSGForRoadSearch.cc:209
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Chi2
Definition: Chi2.h:15
GeomDetEnumerators::PixelBarrel
Definition: GeomDetEnumerators.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
CkfComponentsRecord
Definition: CkfComponentsRecord.h:22
GeometricSearchTracker::posTecLayers
std::vector< ForwardDetLayer const * > const & posTecLayers() const
Definition: GeometricSearchTracker.h:47
SurfaceOrientation::inner
Definition: Surface.h:19
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TSGForRoadSearch::theCategory
std::string theCategory
Definition: TSGForRoadSearch.h:109
DDAxes::z
Chi2MeasurementEstimator_cfi.Chi2MeasurementEstimator
Chi2MeasurementEstimator
Definition: Chi2MeasurementEstimator_cfi.py:5
GeometricSearchTracker::posTidLayers
std::vector< ForwardDetLayer const * > const & posTidLayers() const
Definition: GeometricSearchTracker.h:46
MeasurementTrackerEvent::idToDet
MeasurementDetWithData idToDet(const DetId &id) const
Previous MeasurementDetSystem interface.
Definition: MeasurementTrackerEvent.h:69
TSGForRoadSearch::thePropagatorName
std::string thePropagatorName
Definition: TSGForRoadSearch.h:104
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
MuonServiceProxy::eventSetup
const edm::EventSetup & eventSetup() const
Definition: MuonServiceProxy.h:76
TrajectoryStateUpdator::update
virtual TrajectoryStateOnSurface update(const TrajectoryStateOnSurface &, const TrackingRecHit &) const =0
MuonErrorMatrix::adjust
void adjust(FreeTrajectoryState &state)
adjust the error matrix on the state
Definition: MuonErrorMatrix.cc:502
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
GeometricSearchTracker::negTecLayers
std::vector< ForwardDetLayer const * > const & negTecLayers() const
Definition: GeometricSearchTracker.h:43
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
GeometricSearchTracker::posPixelForwardLayers
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
Definition: GeometricSearchTracker.h:45
GeomDetEnumerators::TEC
Definition: GeomDetEnumerators.h:16
GeometricSearchDet::compatibleDetsV
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
Definition: GeometricSearchDet.cc:9
TSGForRoadSearch::theMeasurementTrackerEvent
const MeasurementTrackerEvent * theMeasurementTrackerEvent
Definition: TSGForRoadSearch.h:96
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
MuonServiceProxy::propagator
edm::ESHandle< Propagator > propagator(std::string propagatorName) const
get the propagator
Definition: MuonServiceProxy.cc:177
TSGForRoadSearch::theMeasurementTrackerEventToken
edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerEventToken
Definition: TSGForRoadSearch.h:95
TSGForRoadSearch::pushTrajectorySeed
void pushTrajectorySeed(const reco::Track &muon, std::vector< DetLayer::DetWithState > &compatible, PropagationDirection direction, std::vector< TrajectorySeed > &result) const
add the seed(s) to the collection of seeds
Definition: TSGForRoadSearch.cc:465
StateOnTrackerBound
Definition: StateOnTrackerBound.h:13
TSGForRoadSearch::theErrorMatrixAdjuster
MuonErrorMatrix * theErrorMatrixAdjuster
Definition: TSGForRoadSearch.h:111
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
get
#define get
TSGForRoadSearch::makeSeeds_3
void makeSeeds_3(const reco::Track &, std::vector< TrajectorySeed > &)
outside-in: outermost Strip layer
Definition: TSGForRoadSearch.cc:222
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
TSGForRoadSearch::theGeometricSearchTracker
edm::ESHandle< GeometricSearchTracker > theGeometricSearchTracker
Definition: TSGForRoadSearch.h:92
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
TSGForRoadSearch::thePropagatorCompatibleName
std::string thePropagatorCompatibleName
Definition: TSGForRoadSearch.h:106
TSGForRoadSearch::theChi2Estimator
Chi2MeasurementEstimator * theChi2Estimator
Definition: TSGForRoadSearch.h:108
MeasurementDetWithData
Definition: MeasurementDetWithData.h:6
TSGForRoadSearch::theMeasurementTrackerEventTag
edm::InputTag theMeasurementTrackerEventTag
Definition: TSGForRoadSearch.h:94
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
GeometricSearchTracker::negPixelForwardLayers
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
Definition: GeometricSearchTracker.h:41
TrajectoryMeasurement::ConstRecHitPointer
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
Definition: TrajectoryMeasurement.h:28
TSGForRoadSearch::makeSeeds_0
void makeSeeds_0(const reco::Track &, std::vector< TrajectorySeed > &)
oseed from inside-out: innermost Strip layer
Definition: TSGForRoadSearch.cc:139
GeomDetEnumerators::subDetGeom
constexpr SubDetector subDetGeom[21]
Definition: GeomDetEnumerators.h:40
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
TrajectorySeed
Definition: TrajectorySeed.h:17
MuonServiceProxy::magneticField
edm::ESHandle< MagneticField > magneticField() const
get the magnetic field
Definition: MuonServiceProxy.h:56
MuonErrorMatrix
Definition: MuonErrorMatrix.h:24
TSGForRoadSearch::theManySeeds
bool theManySeeds
Definition: TSGForRoadSearch.h:103
GeomDetEnumerators::PixelEndcap
Definition: GeomDetEnumerators.h:12
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
edm::OwnVector::push_back
void push_back(D *&d)
Definition: OwnVector.h:326
mps_fire.result
result
Definition: mps_fire.py:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
HLT_2018_cff.errorMatrixPset
errorMatrixPset
Definition: HLT_2018_cff.py:44406
TSGForRoadSearch::theUpdator
TrajectoryStateUpdator * theUpdator
Definition: TSGForRoadSearch.h:98
SurfaceOrientation::outer
Definition: Surface.h:19
TSGForRoadSearch::IPfts
bool IPfts(const reco::Track &, FreeTrajectoryState &)
get the FTS for a Track: adjusting the error matrix if requested
Definition: TSGForRoadSearch.cc:119
edm::OwnVector::clear
void clear()
Definition: OwnVector.h:481
edm::InputTag
Definition: InputTag.h:15
alongMomentum
Definition: PropagationDirection.h:4
KFUpdator
Definition: KFUpdator.h:32
TSGForRoadSearch::theCopyMuonRecHit
bool theCopyMuonRecHit
Definition: TSGForRoadSearch.h:102
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
GeometricSearchTracker::negTidLayers
std::vector< ForwardDetLayer const * > const & negTidLayers() const
Definition: GeometricSearchTracker.h:42
GeometricSearchTracker::pixelBarrelLayers
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
Definition: GeometricSearchTracker.h:37
TSGForRoadSearch::theProxyService
const MuonServiceProxy * theProxyService
Definition: TSGForRoadSearch.h:99