CMS 3D CMS Logo

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

#include <StandAloneTrajectoryBuilder.h>

Inheritance diagram for StandAloneMuonTrajectoryBuilder:
MuonTrajectoryBuilder

Public Types

typedef std::pair< const DetLayer *, TrajectoryStateOnSurfaceDetLayerWithState
 
- Public Types inherited from MuonTrajectoryBuilder
typedef MuonCandidate::CandidateContainer CandidateContainer
 
typedef std::pair< const Trajectory *, reco::TrackRefTrackCand
 
typedef MuonCandidate::TrajectoryContainer TrajectoryContainer
 

Public Member Functions

StandAloneMuonFilterbwfilter () const
 actual filter More...
 
StandAloneMuonFilterfilter () const
 pre-filter More...
 
StandAloneMuonRefitterrefitter () const
 refitter of the hits container More...
 
void setEvent (const edm::Event &event) override
 Pass the Event to the algo at each event. More...
 
 StandAloneMuonTrajectoryBuilder (const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &iC)
 Constructor with Parameter set and MuonServiceProxy. More...
 
CandidateContainer trajectories (const TrackCand &) override
 dummy implementation, unused in this class More...
 
TrajectoryContainer trajectories (const TrajectorySeed &) override
 return a container of the reconstructed trajectories compatible with a given seed More...
 
 ~StandAloneMuonTrajectoryBuilder () override
 Destructor. More...
 
- Public Member Functions inherited from MuonTrajectoryBuilder
 MuonTrajectoryBuilder ()
 constructor More...
 
virtual ~MuonTrajectoryBuilder ()
 destructor More...
 

Private Member Functions

DetLayerWithState propagateTheSeedTSOS (TrajectoryStateOnSurface &aTSOS, DetId &aDetId)
 

Private Attributes

bool doBackwardFilter
 
bool doRefit
 
bool doSeedRefit
 
StandAloneMuonFiltertheBWFilter
 
std::string theBWSeedType
 
StandAloneMuonFiltertheFilter
 
std::string theNavigationType
 
StandAloneMuonRefittertheRefitter
 
recoMuon::SeedPosition theSeedPosition
 
std::string theSeedPropagatorName
 Propagator for the seed extrapolation. More...
 
SeedTransformertheSeedTransformer
 
const MuonServiceProxytheService
 

Detailed Description

Definition at line 26 of file StandAloneTrajectoryBuilder.h.

Member Typedef Documentation

◆ DetLayerWithState

Definition at line 28 of file StandAloneTrajectoryBuilder.h.

Constructor & Destructor Documentation

◆ StandAloneMuonTrajectoryBuilder()

StandAloneMuonTrajectoryBuilder::StandAloneMuonTrajectoryBuilder ( const edm::ParameterSet par,
const MuonServiceProxy service,
edm::ConsumesCollector iC 
)

Constructor with Parameter set and MuonServiceProxy.

Definition at line 41 of file StandAloneTrajectoryBuilder.cc.

44  : theService(service) {
45  const std::string metname = "Muon|RecoMuon|StandAloneMuonTrajectoryBuilder";
46 
47  LogTrace(metname) << "constructor called" << endl;
48 
49  // The navigation type:
50  // "Direct","Standard"
51  theNavigationType = par.getParameter<string>("NavigationType");
52 
53  // The inward-outward fitter (starts from seed state)
54  ParameterSet filterPSet = par.getParameter<ParameterSet>("FilterParameters");
55  filterPSet.addParameter<string>("NavigationType", theNavigationType);
56  theFilter = new StandAloneMuonFilter(filterPSet, theService, iC);
57 
58  // Fit direction
59  string seedPosition = par.getParameter<string>("SeedPosition");
60 
61  if (seedPosition == "in")
63  else if (seedPosition == "out")
65  else
66  throw cms::Exception("StandAloneMuonFilter constructor")
67  << "Wrong seed position chosen in StandAloneMuonFilter::StandAloneMuonFilter ParameterSet"
68  << "\n"
69  << "Possible choices are:"
70  << "\n"
71  << "SeedPosition = in or SeedPosition = out";
72 
73  // Propagator for the seed extrapolation
74  theSeedPropagatorName = par.getParameter<string>("SeedPropagator");
75 
76  // Disable/Enable the backward filter
77  doBackwardFilter = par.getParameter<bool>("DoBackwardFilter");
78 
79  // Disable/Enable the refit of the trajectory
80  doRefit = par.getParameter<bool>("DoRefit");
81 
82  // Disable/Enable the refit of the trajectory seed
83  doSeedRefit = par.getParameter<bool>("DoSeedRefit");
84 
85  if (doBackwardFilter) {
86  // The outward-inward fitter (starts from theFilter outermost state)
87  ParameterSet bwFilterPSet = par.getParameter<ParameterSet>("BWFilterParameters");
88  // theBWFilter = new StandAloneMuonBackwardFilter(bwFilterPSet,theService); // FIXME
89  bwFilterPSet.addParameter<string>("NavigationType", theNavigationType);
90  theBWFilter = new StandAloneMuonFilter(bwFilterPSet, theService, iC);
91 
92  theBWSeedType = bwFilterPSet.getParameter<string>("BWSeedType");
93  }
94 
95  if (doRefit) {
96  // The outward-inward fitter (starts from theBWFilter innermost state)
97  ParameterSet refitterPSet = par.getParameter<ParameterSet>("RefitterParameters");
98  theRefitter = new StandAloneMuonRefitter(refitterPSet, theService);
99  }
100 
101  // The seed transformer (used to refit the seed and get the seed transient state)
102  // ParameterSet seedTransformerPSet = par.getParameter<ParameterSet>("SeedTransformerParameters");
103  ParameterSet seedTransformerParameters = par.getParameter<ParameterSet>("SeedTransformerParameters");
104  theSeedTransformer = new SeedTransformer(seedTransformerParameters);
105 }

References edm::ParameterSet::addParameter(), doBackwardFilter, doRefit, doSeedRefit, Exception, edm::ParameterSet::getParameter(), recoMuon::in, LogTrace, metname, recoMuon::out, AlCaHLTBitMon_QueryRunRegistry::string, theBWFilter, theBWSeedType, theFilter, theNavigationType, theRefitter, theSeedPosition, theSeedPropagatorName, theSeedTransformer, and theService.

◆ ~StandAloneMuonTrajectoryBuilder()

StandAloneMuonTrajectoryBuilder::~StandAloneMuonTrajectoryBuilder ( )
override

Destructor.

Definition at line 113 of file StandAloneTrajectoryBuilder.cc.

113  {
114  LogTrace("Muon|RecoMuon|StandAloneMuonTrajectoryBuilder")
115  << "StandAloneMuonTrajectoryBuilder destructor called" << endl;
116 
117  if (theFilter)
118  delete theFilter;
120  delete theBWFilter;
121  if (doRefit && theRefitter)
122  delete theRefitter;
123  if (theSeedTransformer)
124  delete theSeedTransformer;
125 }

References doBackwardFilter, doRefit, LogTrace, theBWFilter, theFilter, theRefitter, and theSeedTransformer.

Member Function Documentation

◆ bwfilter()

StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::bwfilter ( ) const
inline

actual filter

Definition at line 48 of file StandAloneTrajectoryBuilder.h.

48 { return theBWFilter; }

References theBWFilter.

Referenced by trajectories().

◆ filter()

StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::filter ( ) const
inline

pre-filter

Definition at line 45 of file StandAloneTrajectoryBuilder.h.

45 { return theFilter; }

References theFilter.

Referenced by trajectories().

◆ propagateTheSeedTSOS()

StandAloneMuonTrajectoryBuilder::DetLayerWithState StandAloneMuonTrajectoryBuilder::propagateTheSeedTSOS ( TrajectoryStateOnSurface aTSOS,
DetId aDetId 
)
private

Definition at line 392 of file StandAloneTrajectoryBuilder.cc.

393  {
394  const std::string metname = "Muon|RecoMuon|StandAloneMuonTrajectoryBuilder";
396 
397  DetId seedDetId(aDetId);
398  // const GeomDet* gdet = theService->trackingGeometry()->idToDet( seedDetId );
399 
400  TrajectoryStateOnSurface initialState(aTSOS);
401 
402  LogTrace(metname) << "Seed's Pt: " << initialState.freeState()->momentum().perp() << endl;
403 
404  LogTrace(metname) << "Seed's id: " << endl;
405  LogTrace(metname) << debug.dumpMuonId(seedDetId);
406 
407  // Get the layer on which the seed relies
408  const DetLayer* initialLayer = theService->detLayerGeometry()->idToLayer(seedDetId);
409 
410  LogTrace(metname) << "Seed's detLayer: " << endl;
411  LogTrace(metname) << debug.dumpLayer(initialLayer);
412 
413  LogTrace(metname) << "TrajectoryStateOnSurface before propagation:" << endl;
414  LogTrace(metname) << debug.dumpTSOS(initialState);
415 
417 
418  // ask for compatible layers
419  vector<const DetLayer*> detLayers;
420 
421  if (theNavigationType == "Standard")
422  detLayers =
423  theService->muonNavigationSchool()->compatibleLayers(*initialLayer, *initialState.freeState(), detLayerOrder);
424  else if (theNavigationType == "Direct") {
425  DirectMuonNavigation navigation(&*theService->detLayerGeometry());
426  detLayers = navigation.compatibleLayers(*initialState.freeState(), detLayerOrder);
427  } else
428  edm::LogError(metname) << "No Properly Navigation Selected!!" << endl;
429 
430  LogTrace(metname) << "There are " << detLayers.size() << " compatible layers" << endl;
431 
432  DetLayerWithState result = DetLayerWithState(initialLayer, initialState);
433 
434  if (!detLayers.empty()) {
435  LogTrace(metname) << "Compatible layers:" << endl;
436  for (vector<const DetLayer*>::const_iterator layer = detLayers.begin(); layer != detLayers.end(); layer++) {
437  LogTrace(metname) << debug.dumpMuonId((*layer)->basicComponents().front()->geographicalId());
438  LogTrace(metname) << debug.dumpLayer(*layer);
439  }
440 
441  const DetLayer* finalLayer = detLayers.back();
442 
444  LogTrace(metname) << "Most internal one:" << endl;
445  else
446  LogTrace(metname) << "Most external one:" << endl;
447 
448  LogTrace(metname) << debug.dumpLayer(finalLayer);
449 
450  const TrajectoryStateOnSurface propagatedState =
451  theService->propagator(theSeedPropagatorName)->propagate(initialState, finalLayer->surface());
452 
453  if (propagatedState.isValid()) {
454  result = DetLayerWithState(finalLayer, propagatedState);
455 
456  LogTrace(metname) << "Trajectory State on Surface after the extrapolation" << endl;
457  LogTrace(metname) << debug.dumpTSOS(propagatedState);
458  LogTrace(metname) << debug.dumpLayer(finalLayer);
459  } else
460  LogTrace(metname) << "Extrapolation failed. Keep the original seed state" << endl;
461  } else
462  LogTrace(metname) << "No compatible layers. Keep the original seed state" << endl;
463 
464  return result;
465 }

References alongMomentum, DirectMuonNavigation::compatibleLayers(), debug, TrajectoryStateOnSurface::freeState(), recoMuon::in, TrajectoryStateOnSurface::isValid(), LogTrace, metname, FreeTrajectoryState::momentum(), oppositeToMomentum, PV3DBase< T, PVType, FrameType >::perp(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, GeometricSearchDet::surface(), theNavigationType, theSeedPosition, theSeedPropagatorName, and theService.

Referenced by trajectories().

◆ refitter()

StandAloneMuonRefitter* StandAloneMuonTrajectoryBuilder::refitter ( ) const
inline

refitter of the hits container

Definition at line 51 of file StandAloneTrajectoryBuilder.h.

51 { return theRefitter; }

References theRefitter.

Referenced by trajectories().

◆ setEvent()

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

Pass the Event to the algo at each event.

Implements MuonTrajectoryBuilder.

Definition at line 107 of file StandAloneTrajectoryBuilder.cc.

107  {
109  if (doBackwardFilter)
111 }

References doBackwardFilter, StandAloneMuonFilter::setEvent(), theBWFilter, and theFilter.

Referenced by ExhaustiveMuonTrajectoryBuilder::setEvent().

◆ trajectories() [1/2]

CandidateContainer StandAloneMuonTrajectoryBuilder::trajectories ( const TrackCand )
inlineoverridevirtual

dummy implementation, unused in this class

Implements MuonTrajectoryBuilder.

Definition at line 42 of file StandAloneTrajectoryBuilder.h.

42 { return CandidateContainer(); }

◆ trajectories() [2/2]

MuonTrajectoryBuilder::TrajectoryContainer StandAloneMuonTrajectoryBuilder::trajectories ( const TrajectorySeed )
overridevirtual

return a container of the reconstructed trajectories compatible with a given seed

Implements MuonTrajectoryBuilder.

Definition at line 138 of file StandAloneTrajectoryBuilder.cc.

138  {
139  Resetter fwReset(filter());
140  Resetter bwReset(bwfilter());
141 
142  const std::string metname = "Muon|RecoMuon|StandAloneMuonTrajectoryBuilder";
144 
145  // Set the services for the seed transformer
146  theSeedTransformer->setServices(theService->eventSetup());
147 
148  // the trajectory container. In principle starting from one seed we can
149  // obtain more than one trajectory. TODO: this feature is not yet implemented!
150  TrajectoryContainer trajectoryContainer;
151 
153  Trajectory trajectoryFW(seed, fwDirection);
154 
155  TrajectoryStateOnSurface lastTSOS;
156  DetId lastDetId;
157 
158  vector<Trajectory> seedTrajectories;
159 
160  if (doSeedRefit) {
161  seedTrajectories = theSeedTransformer->seedTransform(seed);
162  if (!seedTrajectories.empty()) {
163  TrajectoryMeasurement lastTM(seedTrajectories.front().lastMeasurement());
164  lastTSOS = lastTM.updatedState();
165  lastDetId = lastTM.recHit()->geographicalId();
166  }
167  }
168 
169  if (!doSeedRefit || seedTrajectories.empty()) {
171  lastDetId = seed.startingState().detId();
172  }
173 
174  LogTrace(metname) << "Trajectory State on Surface before the extrapolation" << endl;
175  LogTrace(metname) << debug.dumpTSOS(lastTSOS);
176 
177  // Segment layer
178  LogTrace(metname) << "The RecSegment relies on: " << endl;
179  LogTrace(metname) << debug.dumpMuonId(lastDetId);
180 
181  DetLayerWithState inputFromSeed = propagateTheSeedTSOS(lastTSOS, lastDetId);
182 
183  // refine the FTS given by the seed
184 
185  // the trajectory is filled in the refitter::refit
186  filter()->refit(inputFromSeed.second, inputFromSeed.first, trajectoryFW);
187 
188  // "0th order" check...
189  if (trajectoryFW.empty()) {
190  LogTrace(metname) << "Forward trajectory EMPTY! No trajectory will be loaded!" << endl;
191  return trajectoryContainer;
192  }
193 
194  // Get the last TSOS
195  // TrajectoryStateOnSurface tsosAfterRefit = filter()->lastUpdatedTSOS(); // this is the last UPDATED TSOS
196  TrajectoryStateOnSurface tsosAfterRefit = filter()->lastCompatibleTSOS(); // this is the last COMPATIBLE TSOS
197 
198  LogTrace(metname) << "StandAloneMuonTrajectoryBuilder filter output " << endl;
199  LogTrace(metname) << debug.dumpTSOS(tsosAfterRefit);
200 
201  /*
202  // -- 1st attempt
203  if( filter()->isCompatibilitySatisfied() ) {
204  if( filter()->layers().size() ) // OR if( filter()->goodState() ) ??? Maybe when only RPC hits are used...
205  LogTrace(metname) << debug.dumpLayer( filter()->lastDetLayer() );
206  else {
207  LogTrace(metname) << "Compatibility satisfied, but all RecHits are invalid! A trajectory with only invalid hits will be loaded!" << endl;
208  trajectoryContainer.push_back(new Trajectory(trajectoryFW));
209  return trajectoryContainer;
210  }
211  }
212  else {
213  LogTrace(metname) << "Compatibility NOT satisfied after Forward filter! No trajectory will be loaded!" << endl;
214  LogTrace(metname) << "Total chambers: " << filter()->getTotalCompatibleChambers() << "; DT: "
215  << filter()->getDTCompatibleChambers() << "; CSC: " << filter()->getCSCCompatibleChambers() << endl;
216  return trajectoryContainer;
217  }
218  // -- end 1st attempt
219  */
220 
221  // -- 2nd attempt
222  if (filter()->goodState()) {
223  LogTrace(metname) << debug.dumpLayer(filter()->lastDetLayer());
224  } else if (filter()->isCompatibilitySatisfied()) {
225  int foundValidRh = trajectoryFW.foundHits(); // number of valid hits
226  LogTrace(metname) << "Compatibility satisfied after Forward filter, but too few valid RecHits (" << foundValidRh
227  << ")." << endl
228  << "A trajectory with only invalid RecHits will be loaded!" << endl;
229  if (!foundValidRh) {
230  trajectoryContainer.push_back(std::make_unique<Trajectory>(trajectoryFW));
231  return trajectoryContainer;
232  }
233  Trajectory defaultTraj(seed, fwDirection);
234  filter()->createDefaultTrajectory(trajectoryFW, defaultTraj);
235  trajectoryContainer.push_back(std::make_unique<Trajectory>(defaultTraj));
236  return trajectoryContainer;
237  } else {
238  LogTrace(metname) << "Compatibility NOT satisfied after Forward filter! No trajectory will be loaded!" << endl;
239  LogTrace(metname) << "Total compatible chambers: " << filter()->getTotalCompatibleChambers()
240  << "; DT: " << filter()->getDTCompatibleChambers()
241  << "; CSC: " << filter()->getCSCCompatibleChambers()
242  << "; RPC: " << filter()->getRPCCompatibleChambers()
243  << "; GEM: " << filter()->getGEMCompatibleChambers()
244  << "; ME0: " << filter()->getME0CompatibleChambers() << endl;
245  return trajectoryContainer;
246  }
247  // -- end 2nd attempt
248 
249  LogTrace(metname) << "Number of DT/CSC/RPC/GEM/ME0 chamber used (fw): " << filter()->getDTChamberUsed() << "/"
250  << filter()->getCSCChamberUsed() << "/" << filter()->getRPCChamberUsed() << "/"
251  << filter()->getGEMChamberUsed() << "/" << filter()->getME0ChamberUsed() << endl;
252  LogTrace(metname) << "Momentum: " << tsosAfterRefit.freeState()->momentum();
253 
254  if (!doBackwardFilter) {
255  LogTrace(metname) << "Only forward refit requested. No backward refit will be performed!" << endl;
256 
257  // ***** Refit of fwd step *****
258  // if (doRefit && !trajectoryFW.empty() && filter()->goodState()){ // CHECK!!! Can trajectoryFW really be empty at this point??? And goodState...?
259  if (doRefit) {
260  pair<bool, Trajectory> refitResult = refitter()->refit(trajectoryFW);
261  if (refitResult.first) {
262  trajectoryContainer.push_back(std::make_unique<Trajectory>(refitResult.second));
263  LogTrace(metname) << "StandAloneMuonTrajectoryBuilder refit output " << endl;
264  LogTrace(metname) << debug.dumpTSOS(refitResult.second.lastMeasurement().updatedState());
265  } else
266  trajectoryContainer.push_back(std::make_unique<Trajectory>(trajectoryFW));
267  } else
268  trajectoryContainer.push_back(std::make_unique<Trajectory>(trajectoryFW));
269 
270  LogTrace(metname) << "Trajectory saved" << endl;
271  return trajectoryContainer;
272  }
273 
274  // ***** Backward filtering *****
275 
276  TrajectorySeed seedForBW;
277 
278  if (theBWSeedType == "noSeed") {
279  } else if (theBWSeedType == "fromFWFit") {
281  tsosAfterRefit, trajectoryFW.lastMeasurement().recHit()->geographicalId().rawId());
282 
283  edm::OwnVector<TrackingRecHit> recHitsContainer;
285  TrajectorySeed fwFit(seedTSOS, recHitsContainer, seedDirection);
286 
287  seedForBW = fwFit;
288  } else if (theBWSeedType == "fromGenerator") {
289  seedForBW = seed;
290  } else
291  LogWarning(metname) << "Wrong seed type for the backward filter!";
292 
294  Trajectory trajectoryBW(seedForBW, bwDirection);
295 
296  // FIXME! under check!
297  bwfilter()->refit(tsosAfterRefit, filter()->lastDetLayer(), trajectoryBW);
298 
299  // Get the last TSOS
300  TrajectoryStateOnSurface tsosAfterBWRefit = bwfilter()->lastUpdatedTSOS();
301 
302  LogTrace(metname) << "StandAloneMuonTrajectoryBuilder BW filter output " << endl;
303  LogTrace(metname) << debug.dumpTSOS(tsosAfterBWRefit);
304 
305  LogTrace(metname) << "Number of RecHits: " << trajectoryBW.foundHits() << "\n"
306  << "Number of DT/CSC/RPC/GEM/ME0 chamber used (bw): " << bwfilter()->getDTChamberUsed() << "/"
307  << bwfilter()->getCSCChamberUsed() << "/" << bwfilter()->getRPCChamberUsed() << "/"
308  << bwfilter()->getGEMChamberUsed() << "/" << bwfilter()->getME0ChamberUsed();
309 
310  // -- The trajectory is "good" if there are at least 2 chambers used in total and at
311  // least 1 is "tracking" (DT or CSC)
312  // -- The trajectory satisfies the "compatibility" requirements if there are at least
313  // 2 compatible chambers (not necessarily used!) in total and at
314  // least 1 is "tracking" (DT or CSC)
315  // 1st attempt
316  /*
317  if (bwfilter()->isCompatibilitySatisfied()) {
318 
319  if (doRefit && !trajectoryBW.empty() && bwfilter()->goodState()){
320  pair<bool,Trajectory> refitResult = refitter()->refit(trajectoryBW);
321  if (refitResult.first){
322  trajectoryContainer.push_back(new Trajectory(refitResult.second));
323  LogTrace(metname) << "StandAloneMuonTrajectoryBuilder Refit output " << endl;
324  LogTrace(metname) << debug.dumpTSOS(refitResult.second.lastMeasurement().updatedState());
325  }
326  else
327  trajectoryContainer.push_back(new Trajectory(trajectoryBW));
328  }
329  else
330  trajectoryContainer.push_back(new Trajectory(trajectoryBW));
331 
332  LogTrace(metname)<< "Trajectory saved" << endl;
333 
334  }
335  //if the trajectory is not saved, but at least two chamber are used in the
336  //forward filtering, try to build a new trajectory starting from the old
337  //trajectory w/o the latest measurement and a looser chi2 cut
338  else if ( filter()->getTotalChamberUsed() >= 2 ) {
339  LogTrace(metname)<< "Trajectory NOT saved. Second Attempt." << endl;
340  // FIXME:
341  // a better choice could be: identify the poorest one, exclude it, redo
342  // the fw and bw filtering. Or maybe redo only the bw without the excluded
343  // measure. As first step I will port the ORCA algo, then I will move to the
344  // above pattern.
345 
346  }
347 
348  else {
349  LogTrace(metname) << "Compatibility NOT satisfied after Backward filter!" << endl;
350  LogTrace(metname) << "The result of Forward filter will be loaded!" << endl;
351 
352  trajectoryContainer.push_back(new Trajectory(trajectoryFW));
353  }
354  */
355  // end 1st attempt
356 
357  // 2nd attempt
358  if (bwfilter()->goodState()) {
359  LogTrace(metname) << debug.dumpLayer(bwfilter()->lastDetLayer());
360  } else if (bwfilter()->isCompatibilitySatisfied()) {
361  LogTrace(metname) << "Compatibility satisfied after Backward filter, but too few valid RecHits ("
362  << trajectoryBW.foundHits() << ")." << endl
363  << "The (good) result of FW filter will be loaded!" << endl;
364  trajectoryContainer.push_back(std::make_unique<Trajectory>(trajectoryFW));
365  return trajectoryContainer;
366  } else {
367  LogTrace(metname) << "Compatibility NOT satisfied after Backward filter!" << endl
368  << "The Forward trajectory will be invalidated and then loaded!" << endl;
369  Trajectory defaultTraj(seed, fwDirection);
370  filter()->createDefaultTrajectory(trajectoryFW, defaultTraj);
371  trajectoryContainer.push_back(std::make_unique<Trajectory>(defaultTraj));
372  return trajectoryContainer;
373  }
374  // end 2nd attempt
375 
376  if (doRefit) {
377  pair<bool, Trajectory> refitResult = refitter()->refit(trajectoryBW);
378  if (refitResult.first) {
379  trajectoryContainer.push_back(std::make_unique<Trajectory>(refitResult.second));
380  LogTrace(metname) << "StandAloneMuonTrajectoryBuilder Refit output " << endl;
381  LogTrace(metname) << debug.dumpTSOS(refitResult.second.lastMeasurement().updatedState());
382  } else
383  trajectoryContainer.push_back(std::make_unique<Trajectory>(trajectoryBW));
384  } else
385  trajectoryContainer.push_back(std::make_unique<Trajectory>(trajectoryBW));
386 
387  LogTrace(metname) << "Trajectory saved" << endl;
388 
389  return trajectoryContainer;
390 }

References alongMomentum, bwfilter(), StandAloneMuonFilter::createDefaultTrajectory(), debug, doBackwardFilter, doRefit, doSeedRefit, Trajectory::empty(), filter(), Trajectory::foundHits(), TrajectoryStateOnSurface::freeState(), StandAloneMuonFilter::getCSCChamberUsed(), StandAloneMuonFilter::getCSCCompatibleChambers(), StandAloneMuonFilter::getDTChamberUsed(), StandAloneMuonFilter::getDTCompatibleChambers(), StandAloneMuonFilter::getGEMChamberUsed(), StandAloneMuonFilter::getGEMCompatibleChambers(), StandAloneMuonFilter::getME0ChamberUsed(), StandAloneMuonFilter::getME0CompatibleChambers(), StandAloneMuonFilter::getRPCChamberUsed(), StandAloneMuonFilter::getRPCCompatibleChambers(), StandAloneMuonFilter::getTotalCompatibleChambers(), recoMuon::in, StandAloneMuonFilter::lastCompatibleTSOS(), Trajectory::lastMeasurement(), StandAloneMuonFilter::lastUpdatedTSOS(), LogTrace, metname, FreeTrajectoryState::momentum(), oppositeToMomentum, trajectoryStateTransform::persistentState(), propagateTheSeedTSOS(), TrajectoryMeasurement::recHit(), StandAloneMuonRefitter::refit(), StandAloneMuonFilter::refit(), refitter(), fileCollector::seed, SeedTransformer::seedTransform(), SeedTransformer::seedTransientState(), SeedTransformer::setServices(), AlCaHLTBitMon_QueryRunRegistry::string, theBWSeedType, theSeedPosition, theSeedTransformer, and theService.

Referenced by ExhaustiveMuonTrajectoryBuilder::trajectories().

Member Data Documentation

◆ doBackwardFilter

bool StandAloneMuonTrajectoryBuilder::doBackwardFilter
private

◆ doRefit

bool StandAloneMuonTrajectoryBuilder::doRefit
private

◆ doSeedRefit

bool StandAloneMuonTrajectoryBuilder::doSeedRefit
private

Definition at line 79 of file StandAloneTrajectoryBuilder.h.

Referenced by StandAloneMuonTrajectoryBuilder(), and trajectories().

◆ theBWFilter

StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::theBWFilter
private

◆ theBWSeedType

std::string StandAloneMuonTrajectoryBuilder::theBWSeedType
private

Definition at line 80 of file StandAloneTrajectoryBuilder.h.

Referenced by StandAloneMuonTrajectoryBuilder(), and trajectories().

◆ theFilter

StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::theFilter
private

◆ theNavigationType

std::string StandAloneMuonTrajectoryBuilder::theNavigationType
private

Navigation type "Direct","Standard"

Definition at line 63 of file StandAloneTrajectoryBuilder.h.

Referenced by propagateTheSeedTSOS(), and StandAloneMuonTrajectoryBuilder().

◆ theRefitter

StandAloneMuonRefitter* StandAloneMuonTrajectoryBuilder::theRefitter
private

◆ theSeedPosition

recoMuon::SeedPosition StandAloneMuonTrajectoryBuilder::theSeedPosition
private

◆ theSeedPropagatorName

std::string StandAloneMuonTrajectoryBuilder::theSeedPropagatorName
private

Propagator for the seed extrapolation.

Definition at line 68 of file StandAloneTrajectoryBuilder.h.

Referenced by propagateTheSeedTSOS(), and StandAloneMuonTrajectoryBuilder().

◆ theSeedTransformer

SeedTransformer* StandAloneMuonTrajectoryBuilder::theSeedTransformer
private

◆ theService

const MuonServiceProxy* StandAloneMuonTrajectoryBuilder::theService
private
SeedTransformer::seedTransientState
TrajectoryStateOnSurface seedTransientState(const TrajectorySeed &) const
Definition: SeedTransformer.cc:126
StandAloneMuonTrajectoryBuilder::theService
const MuonServiceProxy * theService
Definition: StandAloneTrajectoryBuilder.h:82
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
service
Definition: service.py:1
StandAloneMuonFilter::getDTChamberUsed
int getDTChamberUsed() const
Definition: StandAloneMuonFilter.h:70
StandAloneMuonTrajectoryBuilder::filter
StandAloneMuonFilter * filter() const
pre-filter
Definition: StandAloneTrajectoryBuilder.h:45
StandAloneMuonFilter::getCSCCompatibleChambers
int getCSCCompatibleChambers() const
Definition: StandAloneMuonFilter.h:78
DetLayer
Definition: DetLayer.h:21
StandAloneMuonTrajectoryBuilder::theBWFilter
StandAloneMuonFilter * theBWFilter
Definition: StandAloneTrajectoryBuilder.h:71
StandAloneMuonFilter
Definition: StandAloneMuonFilter.h:36
StandAloneMuonFilter::refit
void refit(const TrajectoryStateOnSurface &initialState, const DetLayer *, Trajectory &trajectory)
Perform the inner-outward fitting.
Definition: StandAloneMuonFilter.cc:203
StandAloneMuonFilter::getGEMChamberUsed
int getGEMChamberUsed() const
Definition: StandAloneMuonFilter.h:73
SeedTransformer
Definition: SeedTransformer.h:29
StandAloneMuonFilter::getRPCChamberUsed
int getRPCChamberUsed() const
Definition: StandAloneMuonFilter.h:72
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
oppositeToMomentum
Definition: PropagationDirection.h:4
StandAloneMuonFilter::lastUpdatedTSOS
TrajectoryStateOnSurface lastUpdatedTSOS() const
the Trajectory state on the last surface of the fitting
Definition: StandAloneMuonFilter.h:59
SeedTransformer::seedTransform
std::vector< Trajectory > seedTransform(const TrajectorySeed &) const
Performs the fit.
Definition: SeedTransformer.cc:70
StandAloneMuonFilter::getGEMCompatibleChambers
int getGEMCompatibleChambers() const
Definition: StandAloneMuonFilter.h:80
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
MuonTrajectoryBuilder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrajectoryBuilder.h:24
StandAloneMuonFilter::setEvent
virtual void setEvent(const edm::Event &event)
Pass the Event to the algo at each event.
Definition: StandAloneMuonFilter.cc:143
DirectMuonNavigation
Definition: DirectMuonNavigation.h:20
fileCollector.seed
seed
Definition: fileCollector.py:127
StandAloneMuonFilter::getRPCCompatibleChambers
int getRPCCompatibleChambers() const
Definition: StandAloneMuonFilter.h:79
DetId
Definition: DetId.h:17
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
debug
#define debug
Definition: HDRShower.cc:19
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
StandAloneMuonTrajectoryBuilder::propagateTheSeedTSOS
DetLayerWithState propagateTheSeedTSOS(TrajectoryStateOnSurface &aTSOS, DetId &aDetId)
Definition: StandAloneTrajectoryBuilder.cc:392
MuonPatternRecoDumper
Definition: MuonPatternRecoDumper.h:18
StandAloneMuonTrajectoryBuilder::DetLayerWithState
std::pair< const DetLayer *, TrajectoryStateOnSurface > DetLayerWithState
Definition: StandAloneTrajectoryBuilder.h:28
StandAloneMuonTrajectoryBuilder::theRefitter
StandAloneMuonRefitter * theRefitter
Definition: StandAloneTrajectoryBuilder.h:74
StandAloneMuonTrajectoryBuilder::theSeedTransformer
SeedTransformer * theSeedTransformer
Definition: StandAloneTrajectoryBuilder.h:75
StandAloneMuonTrajectoryBuilder::doSeedRefit
bool doSeedRefit
Definition: StandAloneTrajectoryBuilder.h:79
StandAloneMuonTrajectoryBuilder::theBWSeedType
std::string theBWSeedType
Definition: StandAloneTrajectoryBuilder.h:80
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
StandAloneMuonTrajectoryBuilder::doRefit
bool doRefit
Definition: StandAloneTrajectoryBuilder.h:78
edm::ParameterSet
Definition: ParameterSet.h:47
StandAloneMuonTrajectoryBuilder::doBackwardFilter
bool doBackwardFilter
Definition: StandAloneTrajectoryBuilder.h:77
StandAloneMuonRefitter
Definition: StandAloneMuonRefitter.h:21
recoMuon::in
Definition: RecoMuonEnumerators.h:6
edm::ParameterSet::addParameter
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:135
StandAloneMuonFilter::getCSCChamberUsed
int getCSCChamberUsed() const
Definition: StandAloneMuonFilter.h:71
StandAloneMuonTrajectoryBuilder::refitter
StandAloneMuonRefitter * refitter() const
refitter of the hits container
Definition: StandAloneTrajectoryBuilder.h:51
DirectMuonNavigation::compatibleLayers
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
Definition: DirectMuonNavigation.cc:30
StandAloneMuonTrajectoryBuilder::theSeedPosition
recoMuon::SeedPosition theSeedPosition
Definition: StandAloneTrajectoryBuilder.h:65
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
StandAloneMuonFilter::createDefaultTrajectory
void createDefaultTrajectory(const Trajectory &, Trajectory &)
Definition: StandAloneMuonFilter.cc:358
StandAloneMuonFilter::getDTCompatibleChambers
int getDTCompatibleChambers() const
Definition: StandAloneMuonFilter.h:77
MuonTrajectoryBuilder::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrajectoryBuilder.h:23
StandAloneMuonTrajectoryBuilder::bwfilter
StandAloneMuonFilter * bwfilter() const
actual filter
Definition: StandAloneTrajectoryBuilder.h:48
Trajectory
Definition: Trajectory.h:38
Exception
Definition: hltDiff.cc:246
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
StandAloneMuonTrajectoryBuilder::theNavigationType
std::string theNavigationType
Definition: StandAloneTrajectoryBuilder.h:63
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
StandAloneMuonFilter::lastCompatibleTSOS
TrajectoryStateOnSurface lastCompatibleTSOS() const
the Trajectory state on the last compatible surface
Definition: StandAloneMuonFilter.h:56
TrajectorySeed
Definition: TrajectorySeed.h:18
recoMuon::out
Definition: RecoMuonEnumerators.h:6
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SeedTransformer::setServices
void setServices(const edm::EventSetup &)
Set the services needed by the SeedTransformer.
Definition: SeedTransformer.cc:62
StandAloneMuonFilter::getME0ChamberUsed
int getME0ChamberUsed() const
Definition: StandAloneMuonFilter.h:74
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
StandAloneMuonRefitter::refit
RefitResult refit(const Trajectory &)
Definition: StandAloneMuonRefitter.cc:63
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
StandAloneMuonTrajectoryBuilder::theFilter
StandAloneMuonFilter * theFilter
Definition: StandAloneTrajectoryBuilder.h:70
event
Definition: event.py:1
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
StandAloneMuonFilter::getME0CompatibleChambers
int getME0CompatibleChambers() const
Definition: StandAloneMuonFilter.h:81
StandAloneMuonFilter::getTotalCompatibleChambers
int getTotalCompatibleChambers() const
Definition: StandAloneMuonFilter.h:76
alongMomentum
Definition: PropagationDirection.h:4
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
edm::OwnVector< TrackingRecHit >
StandAloneMuonTrajectoryBuilder::theSeedPropagatorName
std::string theSeedPropagatorName
Propagator for the seed extrapolation.
Definition: StandAloneTrajectoryBuilder.h:68
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40