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  unsigned int countRH = 0;
87 
88  for (TrajectorySeed::recHitContainer::const_iterator itRecHits = aSeed.recHits().first;
89  itRecHits != aSeed.recHits().second;
90  ++itRecHits, ++countRH) {
91  if ((*itRecHits).isValid()) {
93 
94  if (useSubRecHits) {
97  copy(subHits.begin(), subHits.end(), back_inserter(recHits));
98  } else {
99  recHits.push_back(ttrh);
100  }
101  }
102  } // end for(TrajectorySeed::recHitContainer::const_iterator itRecHits=aSeed.recHits().first; itRecHits!=aSeed.recHits().second; ++itRecHits, ++countRH)
103 
104  TrajectoryStateOnSurface aInitTSOS = thePropagator->propagate(aTSOS, recHits.front()->det()->surface());
105 
106  if (!aInitTSOS.isValid()) {
107  LogTrace(metname) << " --- Initial state for refit not valid! ---" << endl;
108  return vector<Trajectory>();
109  }
110 
111  vector<Trajectory> refittedSeed = theFitter->fit(aSeed, recHits, aInitTSOS);
112 
113  if (refittedSeed.empty()) {
114  LogTrace(metname) << " --- Seed fit failed! ---" << endl;
115  return vector<Trajectory>();
116  }
117 
118  else if (!refittedSeed.front().isValid()) {
119  LogTrace(metname) << " --- Seed fitted, but trajectory not valid! ---" << endl;
120  return vector<Trajectory>();
121  }
122 
123  else
124  LogTrace(metname) << " +++ Seed fit succeded! +++" << endl;
125 
126  return refittedSeed;
127 }

References MuonTransientTrackingRecHitBreaker::breakInSubRecHits(), filterCSVwithJSON::copy, TrajectoryStateOnSurface::isValid(), LogTrace, metname, TrajectorySeed::nHits(), 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 129 of file SeedTransformer.cc.

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

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:129
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
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:73
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
TrajectoryFitter::fit
std::vector< Trajectory > fit(const Trajectory &traj, fitType type=standard) const
Definition: TrajectoryFitter.h:43
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
TrajectorySeed::recHits
range recHits() const
Definition: TrajectorySeed.h:52
TrajectorySeed::startingState
PTrajectoryStateOnDet const & startingState() const
Definition: TrajectorySeed.h:55
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
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:43
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12