test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
*, TrajectoryStateOnSurface
DetLayerWithState
 
- Public Types inherited from MuonTrajectoryBuilder
typedef
MuonCandidate::CandidateContainer 
CandidateContainer
 
typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand
 
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...
 
virtual void setEvent (const edm::Event &event)
 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...
 
TrajectoryContainer trajectories (const TrajectorySeed &)
 return a container of the reconstructed trajectories compatible with a given seed More...
 
virtual CandidateContainer trajectories (const TrackCand &)
 dummy implementation, unused in this class More...
 
virtual ~StandAloneMuonTrajectoryBuilder ()
 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 25 of file StandAloneTrajectoryBuilder.h.

Member Typedef Documentation

Definition at line 28 of file StandAloneTrajectoryBuilder.h.

Constructor & Destructor Documentation

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.

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.

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

Destructor.

Definition at line 110 of file StandAloneTrajectoryBuilder.cc.

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

110  {
111 
112  LogTrace("Muon|RecoMuon|StandAloneMuonTrajectoryBuilder")
113  << "StandAloneMuonTrajectoryBuilder destructor called" << endl;
114 
115  if(theFilter) delete theFilter;
117  if(doRefit && theRefitter) delete theRefitter;
119 }
#define LogTrace(id)

Member Function Documentation

StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::bwfilter ( ) const
inline

actual filter

Definition at line 48 of file StandAloneTrajectoryBuilder.h.

References theBWFilter.

Referenced by trajectories().

48 {return theBWFilter;}
StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::filter ( ) const
inline

pre-filter

Definition at line 45 of file StandAloneTrajectoryBuilder.h.

References theFilter.

Referenced by trajectories().

45 {return theFilter;}
StandAloneMuonTrajectoryBuilder::DetLayerWithState StandAloneMuonTrajectoryBuilder::propagateTheSeedTSOS ( TrajectoryStateOnSurface aTSOS,
DetId aDetId 
)
private

Definition at line 409 of file StandAloneTrajectoryBuilder.cc.

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

Referenced by trajectories().

409  {
410 
411  const std::string metname = "Muon|RecoMuon|StandAloneMuonTrajectoryBuilder";
413 
414  DetId seedDetId(aDetId);
415  // const GeomDet* gdet = theService->trackingGeometry()->idToDet( seedDetId );
416 
417  TrajectoryStateOnSurface initialState(aTSOS);
418 
419  LogTrace(metname)<<"Seed's Pt: "<<initialState.freeState()->momentum().perp()<<endl;
420 
421  LogTrace(metname)<< "Seed's id: "<< endl ;
422  LogTrace(metname) << debug.dumpMuonId(seedDetId);
423 
424  // Get the layer on which the seed relies
425  const DetLayer *initialLayer = theService->detLayerGeometry()->idToLayer( seedDetId );
426 
427  LogTrace(metname)<< "Seed's detLayer: "<< endl ;
428  LogTrace(metname) << debug.dumpLayer(initialLayer);
429 
430  LogTrace(metname)<< "TrajectoryStateOnSurface before propagation:" << endl;
431  LogTrace(metname) << debug.dumpTSOS(initialState);
432 
433 
435 
436  // ask for compatible layers
437  vector<const DetLayer*> detLayers;
438 
439  if(theNavigationType == "Standard")
440  detLayers = theService->muonNavigationSchool()->compatibleLayers(*initialLayer, *initialState.freeState(),detLayerOrder);
441  else if (theNavigationType == "Direct"){
442  DirectMuonNavigation navigation( &*theService->detLayerGeometry() );
443  detLayers = navigation.compatibleLayers( *initialState.freeState(),detLayerOrder);
444  }
445  else
446  edm::LogError(metname) << "No Properly Navigation Selected!!"<<endl;
447 
448 
449  LogTrace(metname) << "There are "<< detLayers.size() <<" compatible layers"<<endl;
450 
451  DetLayerWithState result = DetLayerWithState(initialLayer,initialState);
452 
453  if(detLayers.size()){
454 
455  LogTrace(metname) << "Compatible layers:"<<endl;
456  for( vector<const DetLayer*>::const_iterator layer = detLayers.begin();
457  layer != detLayers.end(); layer++){
458  LogTrace(metname) << debug.dumpMuonId((*layer)->basicComponents().front()->geographicalId());
459  LogTrace(metname) << debug.dumpLayer(*layer);
460  }
461 
462  const DetLayer* finalLayer = detLayers.back();
463 
464  if(theSeedPosition == recoMuon::in) LogTrace(metname) << "Most internal one:"<<endl;
465  else LogTrace(metname) << "Most external one:"<<endl;
466 
467  LogTrace(metname) << debug.dumpLayer(finalLayer);
468 
469  const TrajectoryStateOnSurface propagatedState =
470  theService->propagator(theSeedPropagatorName)->propagate(initialState,
471  finalLayer->surface());
472 
473  if(propagatedState.isValid()){
474  result = DetLayerWithState(finalLayer,propagatedState);
475 
476  LogTrace(metname) << "Trajectory State on Surface after the extrapolation"<<endl;
477  LogTrace(metname) << debug.dumpTSOS(propagatedState);
478  LogTrace(metname) << debug.dumpLayer(finalLayer);
479  }
480  else
481  LogTrace(metname)<< "Extrapolation failed. Keep the original seed state" <<endl;
482  }
483  else
484  LogTrace(metname)<< "No compatible layers. Keep the original seed state" <<endl;
485 
486  return result;
487 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
std::string dumpLayer(const DetLayer *layer) const
const std::string metname
PropagationDirection
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
std::string dumpMuonId(const DetId &id) const
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
tuple result
Definition: query.py:137
#define LogTrace(id)
std::pair< const DetLayer *, TrajectoryStateOnSurface > DetLayerWithState
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
std::string theSeedPropagatorName
Propagator for the seed extrapolation.
StandAloneMuonRefitter* StandAloneMuonTrajectoryBuilder::refitter ( ) const
inline

refitter of the hits container

Definition at line 51 of file StandAloneTrajectoryBuilder.h.

References theRefitter.

Referenced by trajectories().

51 {return theRefitter;}
void StandAloneMuonTrajectoryBuilder::setEvent ( const edm::Event event)
virtual

Pass the Event to the algo at each event.

Implements MuonTrajectoryBuilder.

Definition at line 105 of file StandAloneTrajectoryBuilder.cc.

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

Referenced by ExhaustiveMuonTrajectoryBuilder::setEvent().

105  {
106  theFilter->setEvent(event);
108 }
virtual void setEvent(const edm::Event &event)
Pass the Event to the algo at each event.
MuonTrajectoryBuilder::TrajectoryContainer StandAloneMuonTrajectoryBuilder::trajectories ( const TrajectorySeed )
virtual

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

Implements MuonTrajectoryBuilder.

Definition at line 131 of file StandAloneTrajectoryBuilder.cc.

References alongMomentum, bwfilter(), StandAloneMuonFilter::createDefaultTrajectory(), debug, PTrajectoryStateOnDet::detId(), doBackwardFilter, doRefit, doSeedRefit, MuonPatternRecoDumper::dumpLayer(), MuonPatternRecoDumper::dumpMuonId(), MuonPatternRecoDumper::dumpTSOS(), Trajectory::empty(), filter(), Trajectory::foundHits(), TrajectoryStateOnSurface::freeState(), StandAloneMuonFilter::getCSCChamberUsed(), StandAloneMuonFilter::getCSCCompatibleChambers(), StandAloneMuonFilter::getDTChamberUsed(), StandAloneMuonFilter::getDTCompatibleChambers(), StandAloneMuonFilter::getGEMChamberUsed(), StandAloneMuonFilter::getGEMCompatibleChambers(), 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(), TrajectorySeed::startingState(), AlCaHLTBitMon_QueryRunRegistry::string, theBWSeedType, theSeedPosition, theSeedTransformer, and theService.

Referenced by ExhaustiveMuonTrajectoryBuilder::trajectories().

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

dummy implementation, unused in this class

Implements MuonTrajectoryBuilder.

Definition at line 42 of file StandAloneTrajectoryBuilder.h.

42 {return CandidateContainer();}
MuonCandidate::CandidateContainer CandidateContainer

Member Data Documentation

bool StandAloneMuonTrajectoryBuilder::doBackwardFilter
private
bool StandAloneMuonTrajectoryBuilder::doRefit
private
bool StandAloneMuonTrajectoryBuilder::doSeedRefit
private

Definition at line 82 of file StandAloneTrajectoryBuilder.h.

Referenced by StandAloneMuonTrajectoryBuilder(), and trajectories().

StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::theBWFilter
private
std::string StandAloneMuonTrajectoryBuilder::theBWSeedType
private

Definition at line 83 of file StandAloneTrajectoryBuilder.h.

Referenced by StandAloneMuonTrajectoryBuilder(), and trajectories().

StandAloneMuonFilter* StandAloneMuonTrajectoryBuilder::theFilter
private
std::string StandAloneMuonTrajectoryBuilder::theNavigationType
private

Navigation type "Direct","Standard"

Definition at line 66 of file StandAloneTrajectoryBuilder.h.

Referenced by propagateTheSeedTSOS(), and StandAloneMuonTrajectoryBuilder().

StandAloneMuonRefitter* StandAloneMuonTrajectoryBuilder::theRefitter
private
recoMuon::SeedPosition StandAloneMuonTrajectoryBuilder::theSeedPosition
private
std::string StandAloneMuonTrajectoryBuilder::theSeedPropagatorName
private

Propagator for the seed extrapolation.

Definition at line 71 of file StandAloneTrajectoryBuilder.h.

Referenced by propagateTheSeedTSOS(), and StandAloneMuonTrajectoryBuilder().

SeedTransformer* StandAloneMuonTrajectoryBuilder::theSeedTransformer
private
const MuonServiceProxy* StandAloneMuonTrajectoryBuilder::theService
private