CMS 3D CMS Logo

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

#include <SeedTransformer.h>

Public Member Functions

std::vector< TrajectoryseedTransform (const TrajectorySeed &) const
 Performs the fit. More...
 
 SeedTransformer (const edm::ParameterSet &)
 Constructor. More...
 
TrajectoryStateOnSurface seedTransientState (const TrajectorySeed &) const
 
void setServices (const edm::EventSetup &)
 Set the services needed by the SeedTransformer. More...
 
virtual ~SeedTransformer ()
 Destructor. More...
 

Private Attributes

double errorRescale
 Error rescale factor. More...
 
unsigned int nMinRecHits
 Minimum number of RecHits required to perform the fit. More...
 
edm::ESHandle< TrajectoryFittertheFitter
 
std::string theFitterName
 
edm::ESHandle< MagneticFieldtheMagneticField
 
edm::ESHandle< TransientTrackingRecHitBuildertheMuonRecHitBuilder
 
std::string theMuonRecHitBuilderName
 
edm::ESHandle< PropagatorthePropagator
 
std::string thePropagatorName
 
edm::ESHandle< GlobalTrackingGeometrytheTrackingGeometry
 
bool useSubRecHits
 

Detailed Description

Description: this class takes a TrajectorySeed, fits its RecHits and returns a vector of Trajectories. If the fit fails, the returned vector is empty.

Author
D. Trocino - University and INFN Torino

Definition at line 29 of file SeedTransformer.h.

Constructor & Destructor Documentation

◆ SeedTransformer()

SeedTransformer::SeedTransformer ( const edm::ParameterSet iConfig)

Constructor.

Definition at line 46 of file SeedTransformer.cc.

46  {
47  LogTrace("Reco|TrackingTools|SeedTransformer") << "SeedTransformer constructor called." << endl << endl;
48 
49  theFitterName = iConfig.getParameter<string>("Fitter");
50  theMuonRecHitBuilderName = iConfig.getParameter<string>("MuonRecHitBuilder");
51  thePropagatorName = iConfig.getParameter<string>("Propagator");
52 
53  nMinRecHits = iConfig.getParameter<unsigned int>("NMinRecHits");
54  errorRescale = iConfig.getParameter<double>("RescaleError");
55  useSubRecHits = iConfig.getParameter<bool>("UseSubRecHits");
56 }

References edm::ParameterSet::getParameter(), LogTrace, and HLT_FULL_cff::thePropagatorName.

◆ ~SeedTransformer()

SeedTransformer::~SeedTransformer ( )
virtual

Destructor.

Definition at line 58 of file SeedTransformer.cc.

58  {
59  LogTrace("Reco|TrackingTools|SeedTransformer") << "SeedTransformer destructor called." << endl << endl;
60 }

References LogTrace.

Member Function Documentation

◆ seedTransform()

vector< Trajectory > SeedTransformer::seedTransform ( const TrajectorySeed aSeed) const

Performs the fit.

Definition at line 70 of file SeedTransformer.cc.

70  {
71  const string metname = "Reco|TrackingTools|SeedTransformer";
72 
73  LogTrace(metname) << " Number of valid RecHits: " << aSeed.nHits() << endl;
74 
75  if (aSeed.nHits() < nMinRecHits) {
76  LogTrace(metname) << " --- Too few RecHits, no refit performed! ---" << endl;
77  return vector<Trajectory>();
78  }
79 
81 
82  // Rescale errors before refit, not to bias the result
83  aTSOS.rescaleError(errorRescale);
84 
85  vector<TransientTrackingRecHit::ConstRecHitPointer> recHits;
86 
87  for (auto const& recHit : aSeed.recHits()) {
88  if (recHit.isValid()) {
90 
91  if (useSubRecHits) {
94  copy(subHits.begin(), subHits.end(), back_inserter(recHits));
95  } else {
96  recHits.push_back(ttrh);
97  }
98  }
99  }
100 
101  TrajectoryStateOnSurface aInitTSOS = thePropagator->propagate(aTSOS, recHits.front()->det()->surface());
102 
103  if (!aInitTSOS.isValid()) {
104  LogTrace(metname) << " --- Initial state for refit not valid! ---" << endl;
105  return vector<Trajectory>();
106  }
107 
108  vector<Trajectory> refittedSeed = theFitter->fit(aSeed, recHits, aInitTSOS);
109 
110  if (refittedSeed.empty()) {
111  LogTrace(metname) << " --- Seed fit failed! ---" << endl;
112  return vector<Trajectory>();
113  }
114 
115  else if (!refittedSeed.front().isValid()) {
116  LogTrace(metname) << " --- Seed fitted, but trajectory not valid! ---" << endl;
117  return vector<Trajectory>();
118  }
119 
120  else
121  LogTrace(metname) << " +++ Seed fit succeded! +++" << endl;
122 
123  return refittedSeed;
124 }

References MuonTransientTrackingRecHitBreaker::breakInSubRecHits(), filterCSVwithJSON::copy, TrajectoryStateOnSurface::isValid(), LogTrace, metname, TrajectorySeed::nHits(), rpcPointValidation_cfi::recHit, FastTrackerRecHitMaskProducer_cfi::recHits, TrajectorySeed::recHits(), and TrajectoryStateOnSurface::rescaleError().

Referenced by DirectMuonTrajectoryBuilder::trajectories(), and StandAloneMuonTrajectoryBuilder::trajectories().

◆ seedTransientState()

TrajectoryStateOnSurface SeedTransformer::seedTransientState ( const TrajectorySeed tmpSeed) const

Definition at line 126 of file SeedTransformer.cc.

126  {
127  PTrajectoryStateOnDet tmpTSOD = tmpSeed.startingState();
128  DetId tmpDetId(tmpTSOD.detId());
129  const GeomDet* tmpGeomDet = theTrackingGeometry->idToDet(tmpDetId);
130 
131  TrajectoryStateOnSurface tmpTSOS =
132  trajectoryStateTransform::transientState(tmpTSOD, &(tmpGeomDet->surface()), &(*theMagneticField));
133 
134  return tmpTSOS;
135 }

References PTrajectoryStateOnDet::detId(), TrajectorySeed::startingState(), and trajectoryStateTransform::transientState().

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

◆ setServices()

void SeedTransformer::setServices ( const edm::EventSetup iSetup)

Member Data Documentation

◆ errorRescale

double SeedTransformer::errorRescale
private

Error rescale factor.

Definition at line 61 of file SeedTransformer.h.

◆ nMinRecHits

unsigned int SeedTransformer::nMinRecHits
private

Minimum number of RecHits required to perform the fit.

Definition at line 58 of file SeedTransformer.h.

◆ theFitter

edm::ESHandle<TrajectoryFitter> SeedTransformer::theFitter
private

Definition at line 49 of file SeedTransformer.h.

◆ theFitterName

std::string SeedTransformer::theFitterName
private

Definition at line 53 of file SeedTransformer.h.

◆ theMagneticField

edm::ESHandle<MagneticField> SeedTransformer::theMagneticField
private

Definition at line 48 of file SeedTransformer.h.

◆ theMuonRecHitBuilder

edm::ESHandle<TransientTrackingRecHitBuilder> SeedTransformer::theMuonRecHitBuilder
private

Definition at line 50 of file SeedTransformer.h.

◆ theMuonRecHitBuilderName

std::string SeedTransformer::theMuonRecHitBuilderName
private

Definition at line 54 of file SeedTransformer.h.

◆ thePropagator

edm::ESHandle<Propagator> SeedTransformer::thePropagator
private

Definition at line 51 of file SeedTransformer.h.

◆ thePropagatorName

std::string SeedTransformer::thePropagatorName
private

Definition at line 55 of file SeedTransformer.h.

◆ theTrackingGeometry

edm::ESHandle<GlobalTrackingGeometry> SeedTransformer::theTrackingGeometry
private

Definition at line 47 of file SeedTransformer.h.

◆ useSubRecHits

bool SeedTransformer::useSubRecHits
private

Definition at line 63 of file SeedTransformer.h.

SeedTransformer::seedTransientState
TrajectoryStateOnSurface seedTransientState(const TrajectorySeed &) const
Definition: SeedTransformer.cc:126
SeedTransformer::thePropagatorName
std::string thePropagatorName
Definition: SeedTransformer.h:55
GeomDet
Definition: GeomDet.h:27
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
TrajectorySeed::nHits
unsigned int nHits() const
Definition: TrajectorySeed.h:53
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
TransientTrackingRecHitBuilder::build
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
SeedTransformer::theFitterName
std::string theFitterName
Definition: SeedTransformer.h:53
SeedTransformer::theMuonRecHitBuilder
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
Definition: SeedTransformer.h:50
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
DetId
Definition: DetId.h:17
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
SeedTransformer::nMinRecHits
unsigned int nMinRecHits
Minimum number of RecHits required to perform the fit.
Definition: SeedTransformer.h:58
PTrajectoryStateOnDet::detId
unsigned int detId() const
Definition: PTrajectoryStateOnDet.h:65
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
MuonTransientTrackingRecHitBreaker::breakInSubRecHits
static TransientTrackingRecHit::ConstRecHitContainer breakInSubRecHits(TransientTrackingRecHit::ConstRecHitPointer, int granularity)
takes a muon rechit and returns its sub-rechits given a certain granularity
Definition: MuonTransientTrackingRecHitBreaker.cc:5
TrajectoryFitterRecord
Definition: TrajectoryFitterRecord.h:12
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
SeedTransformer::theFitter
edm::ESHandle< TrajectoryFitter > theFitter
Definition: SeedTransformer.h:49
TrackingRecHit::ConstRecHitContainer
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: TrackingRecHit.h:32
SeedTransformer::theMuonRecHitBuilderName
std::string theMuonRecHitBuilderName
Definition: SeedTransformer.h:54
TrackingRecHit::ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Definition: TrackingRecHit.h:25
SeedTransformer::theMagneticField
edm::ESHandle< MagneticField > theMagneticField
Definition: SeedTransformer.h:48
trajectoryStateTransform::transientState
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
Definition: TrajectoryStateTransform.cc:35
SeedTransformer::useSubRecHits
bool useSubRecHits
Definition: SeedTransformer.h:63
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
get
#define get
TrajectorySeed::recHits
RecHitRange recHits() const
Definition: TrajectorySeed.h:52
TrajectoryFitter::fit
std::vector< Trajectory > fit(const Trajectory &traj, fitType type=standard) const
Definition: TrajectoryFitter.h:43
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TrajectorySeed::startingState
PTrajectoryStateOnDet const & startingState() const
Definition: TrajectorySeed.h:55
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
SeedTransformer::theTrackingGeometry
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
Definition: SeedTransformer.h:47
SeedTransformer::thePropagator
edm::ESHandle< Propagator > thePropagator
Definition: SeedTransformer.h:51
SeedTransformer::errorRescale
double errorRescale
Error rescale factor.
Definition: SeedTransformer.h:61
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12