CMS 3D CMS Logo

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

#include <StandAloneMuonFilter.h>

Public Member Functions

void createDefaultTrajectory (const Trajectory &, Trajectory &)
 
MeasurementEstimatorestimator () const
 access at the estimator More...
 
NavigationDirection fitDirection () const
 Return the fit direction. More...
 
int getCSCChamberUsed () const
 
int getCSCCompatibleChambers () const
 
int getDTChamberUsed () const
 
int getDTCompatibleChambers () const
 
int getGEMChamberUsed () const
 
int getGEMCompatibleChambers () const
 
int getME0ChamberUsed () const
 
int getME0CompatibleChambers () const
 
int getRPCChamberUsed () const
 
int getRPCCompatibleChambers () const
 
int getTotalChamberUsed () const
 
int getTotalCompatibleChambers () const
 
bool goodState () const
 
bool isCompatibilitySatisfied () const
 
FreeTrajectoryState lastButOneUpdatedFTS () const
 the last but one free trajectory state More...
 
TrajectoryStateOnSurface lastButOneUpdatedTSOS () const
 the Trajectory state on the last surface of the fitting More...
 
TrajectoryStateOnSurface lastCompatibleTSOS () const
 the Trajectory state on the last compatible surface More...
 
const DetLayerlastDetLayer () const
 return the last det layer More...
 
FreeTrajectoryState lastUpdatedFTS () const
 the last free trajectory state More...
 
TrajectoryStateOnSurface lastUpdatedTSOS () const
 the Trajectory state on the last surface of the fitting More...
 
std::vector< const DetLayer * > layers () const
 return the layer used for the refit More...
 
bool onlyRPC () const
 True if there are only the RPC measurements. More...
 
PropagationDirection propagationDirection () const
 Return the propagation direction. More...
 
const Propagatorpropagator () const
 access at the propagator More...
 
void refit (const TrajectoryStateOnSurface &initialState, const DetLayer *, Trajectory &trajectory)
 Perform the inner-outward fitting. More...
 
void reset ()
 
virtual void setEvent (const edm::Event &event)
 Pass the Event to the algo at each event. More...
 
 StandAloneMuonFilter (const edm::ParameterSet &par, const MuonServiceProxy *service, edm::ConsumesCollector &iC)
 Constructor. More...
 
MuonTrajectoryUpdatorupdator () const
 access at the muon updator More...
 
virtual ~StandAloneMuonFilter ()
 Destructor. More...
 

Private Member Functions

MuonBestMeasurementFinderbestMeasurementFinder () const
 Access to the best measurement finder. More...
 
std::vector< const DetLayer * > compatibleLayers (const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
 Set the rigth Navigation. More...
 
std::vector< TrajectoryMeasurementfindBestMeasurements (const DetLayer *layer, const TrajectoryStateOnSurface &tsos)
 
void incrementChamberCounters (const DetLayer *layer)
 Increment the DT,CSC,RPC counters. More...
 
void incrementCompatibleChamberCounters (const DetLayer *layer)
 
void setLastButOneUpdatedTSOS (TrajectoryStateOnSurface tsos)
 Set the last but one TSOS. More...
 
void setLastCompatibleTSOS (TrajectoryStateOnSurface tsos)
 Set the last compatible TSOS. More...
 
void setLastUpdatedTSOS (TrajectoryStateOnSurface tsos)
 Set the last TSOS. More...
 
bool update (const DetLayer *layer, const TrajectoryMeasurement *meas, Trajectory &trajectory)
 

Private Attributes

int cscChambers
 
int cscCompatibleChambers
 
int dtChambers
 
int dtCompatibleChambers
 
int gemChambers
 
int gemCompatibleChambers
 
int me0Chambers
 
int me0CompatibleChambers
 
int rpcChambers
 
int rpcCompatibleChambers
 
MuonBestMeasurementFindertheBestMeasurementFinder
 The best measurement finder: search for the best measurement among the TMs available. More...
 
std::vector< const DetLayer * > theDetLayers
 the det layer used in the reconstruction More...
 
MeasurementEstimatortheEstimator
 The Estimator. More...
 
NavigationDirection theFitDirection
 the propagation direction More...
 
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
 the trajectory state on the last but one available surface More...
 
TrajectoryStateOnSurface theLastCompatibleTSOS
 the trajectory state on the last compatible surface More...
 
TrajectoryStateOnSurface theLastUpdatedTSOS
 the trajectory state on the last available surface More...
 
double theMaxChi2
 The max allowed chi2 to accept a rechit in the fit. More...
 
MuonDetLayerMeasurementstheMeasurementExtractor
 The Measurement extractor. More...
 
MuonTrajectoryUpdatortheMuonUpdator
 the muon updator (it doesn't inhert from an updator, but it has one!) More...
 
std::string theMuonUpdatorName
 its name More...
 
std::string theNavigationType
 
double theNSigma
 
bool theOverlappingChambersFlag
 
std::string thePropagatorName
 the propagator name More...
 
bool theRPCLoneliness
 True if there are only the RPC measurements. More...
 
const MuonServiceProxytheService
 
int totalChambers
 
int totalCompatibleChambers
 

Detailed Description

The inward-outward fitter (starts from seed state).

Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch D. Trocino - INFN Torino danie.nosp@m.le.t.nosp@m.rocin.nosp@m.o@to.nosp@m..infn.nosp@m..it

Modified by C. Calabria & A. Sharma Modified by D. Nash

The inward-outward fitter (starts from seed state).

Author
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch D. Trocino - INFN Torino danie.nosp@m.le.t.nosp@m.rocin.nosp@m.o@to.nosp@m..infn.nosp@m..it

Modified by C. Calabria Modified by D. Nash

Definition at line 32 of file StandAloneMuonFilter.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 42 of file StandAloneMuonFilter.cc.

References Chi2MeasurementEstimator_cfi::Chi2MeasurementEstimator, Exception, fitDirection(), edm::ParameterSet::getParameter(), insideOut, outsideIn, theBestMeasurementFinder, theEstimator, theFitDirection, theMaxChi2, theMeasurementExtractor, theMuonUpdator, theNavigationType, theNSigma, thePropagatorName, and theRPCLoneliness.

47 {
48  // Fit direction
49  string fitDirectionName = par.getParameter<string>("FitDirection");
50 
51  if (fitDirectionName == "insideOut" ) theFitDirection = insideOut;
52  else if (fitDirectionName == "outsideIn" ) theFitDirection = outsideIn;
53  else
54  throw cms::Exception("StandAloneMuonFilter constructor")
55  <<"Wrong fit direction chosen in StandAloneMuonFilter::StandAloneMuonFilter ParameterSet"
56  << "\n"
57  << "Possible choices are:"
58  << "\n"
59  << "FitDirection = insideOut or FitDirection = outsideIn";
60 
61  // The max allowed chi2 to accept a rechit in the fit
62  theMaxChi2 = par.getParameter<double>("MaxChi2");
63 
64  // The errors of the trajectory state are multiplied by nSigma
65  // to define acceptance of BoundPlane and maximalLocalDisplacement
66  theNSigma = par.getParameter<double>("NumberOfSigma"); // default = 3.
67 
68  // The navigation type:
69  // "Direct","Standard"
70  theNavigationType = par.getParameter<string>("NavigationType");
71 
72  // The estimator: makes the decision wheter a measure is good or not
73  // it isn't used by the updator which does the real fit. In fact, in principle,
74  // a looser request onto the measure set can be requested
75  // (w.r.t. the request on the accept/reject measure in the fit)
77 
78  thePropagatorName = par.getParameter<string>("Propagator");
79 
81 
82  // Muon trajectory updator parameters
83  ParameterSet muonUpdatorPSet = par.getParameter<ParameterSet>("MuonTrajectoryUpdatorParameters");
84 
85  // the updator needs the fit direction
86  theMuonUpdator = new MuonTrajectoryUpdator(muonUpdatorPSet,
87  fitDirection() );
88 
89  // Measurement Extractor: enable the measure for each muon sub detector
90  bool enableDTMeasurement = par.getParameter<bool>("EnableDTMeasurement");
91  bool enableCSCMeasurement = par.getParameter<bool>("EnableCSCMeasurement");
92  bool enableRPCMeasurement = par.getParameter<bool>("EnableRPCMeasurement");
93  bool enableGEMMeasurement = par.getParameter<bool>("EnableGEMMeasurement");
94  bool enableME0Measurement = par.getParameter<bool>("EnableME0Measurement");
95 
97  par.getParameter<InputTag>("CSCRecSegmentLabel"),
98  par.getParameter<InputTag>("RPCRecSegmentLabel"),
99  par.getParameter<InputTag>("GEMRecSegmentLabel"),
100  par.getParameter<InputTag>("ME0RecSegmentLabel"),
101  iC,
102  enableDTMeasurement,
103  enableCSCMeasurement,
104  enableRPCMeasurement,
105  enableGEMMeasurement,
106  enableME0Measurement);
107 
108  theRPCLoneliness = (!(enableDTMeasurement && enableCSCMeasurement)) ? enableRPCMeasurement : false;
109 }
T getParameter(std::string const &) const
NavigationDirection fitDirection() const
Return the fit direction.
double theMaxChi2
The max allowed chi2 to accept a rechit in the fit.
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)
bool theRPCLoneliness
True if there are only the RPC measurements.
std::string thePropagatorName
the propagator name
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
NavigationDirection theFitDirection
the propagation direction
MeasurementEstimator * theEstimator
The Estimator.
MuonBestMeasurementFinder * theBestMeasurementFinder
The best measurement finder: search for the best measurement among the TMs available.
const MuonServiceProxy * theService
StandAloneMuonFilter::~StandAloneMuonFilter ( )
virtual

Destructor.

Definition at line 111 of file StandAloneMuonFilter.cc.

References LogTrace, theBestMeasurementFinder, theEstimator, theMeasurementExtractor, and theMuonUpdator.

111  {
112 
113  LogTrace("Muon|RecoMuon|StandAloneMuonFilter")
114  <<"StandAloneMuonFilter destructor called"<<endl;
115 
116  delete theEstimator;
117  delete theMuonUpdator;
120 }
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
#define LogTrace(id)
MeasurementEstimator * theEstimator
The Estimator.
MuonBestMeasurementFinder * theBestMeasurementFinder
The best measurement finder: search for the best measurement among the TMs available.

Member Function Documentation

MuonBestMeasurementFinder* StandAloneMuonFilter::bestMeasurementFinder ( ) const
inlineprivate

Access to the best measurement finder.

Definition at line 166 of file StandAloneMuonFilter.h.

Referenced by findBestMeasurements().

166 {return theBestMeasurementFinder;}
MuonBestMeasurementFinder * theBestMeasurementFinder
The best measurement finder: search for the best measurement among the TMs available.
vector< const DetLayer * > StandAloneMuonFilter::compatibleLayers ( const DetLayer initialLayer,
const FreeTrajectoryState fts,
PropagationDirection  propDir 
)
private

Set the rigth Navigation.

Definition at line 181 of file StandAloneMuonFilter.cc.

References DirectMuonNavigation::compatibleLayers(), theNavigationType, and theService.

Referenced by refit().

183  {
184  vector<const DetLayer*> detLayers;
185 
186  if(theNavigationType == "Standard"){
187  // ask for compatible layers
188  detLayers = theService->muonNavigationSchool()->compatibleLayers(*initialLayer,fts,propDir);
189  // I have to fit by hand the first layer until the seedTSOS is defined on the first rechit layer
190  // In fact the first layer is not returned by initialLayer->compatibleLayers.
191  detLayers.insert(detLayers.begin(),initialLayer);
192  }
193  else if (theNavigationType == "Direct"){
194  DirectMuonNavigation navigation(theService->detLayerGeometry());
195  detLayers = navigation.compatibleLayers(fts,propDir);
196  }
197  else
198  edm::LogError("Muon|RecoMuon|StandAloneMuonFilter") << "No Properly Navigation Selected!!"<<endl;
199 
200  return detLayers;
201 }
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
const MuonServiceProxy * theService
void StandAloneMuonFilter::createDefaultTrajectory ( const Trajectory oldTraj,
Trajectory defTraj 
)

Definition at line 372 of file StandAloneMuonFilter.cc.

References Trajectory::measurements(), eostools::move(), Trajectory::push(), Trajectory::reserve(), and MuonTransientTrackingRecHit::specificBuild().

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

372  {
373 
374  Trajectory::DataContainer const & oldMeas = oldTraj.measurements();
375  defTraj.reserve(oldMeas.size());
376 
377  for (Trajectory::DataContainer::const_iterator itm = oldMeas.begin(); itm != oldMeas.end(); itm++) {
378  if( !(*itm).recHit()->isValid() )
379  defTraj.push( *itm, (*itm).estimate() );
380  else {
381  MuonTransientTrackingRecHit::MuonRecHitPointer invRhPtr = MuonTransientTrackingRecHit::specificBuild( (*itm).recHit()->det(), (*itm).recHit()->hit() );
382  invRhPtr->invalidateHit();
383  TrajectoryMeasurement invRhMeas( (*itm).forwardPredictedState(), (*itm).updatedState(), invRhPtr, (*itm).estimate(), (*itm).layer() );
384  defTraj.push( std::move(invRhMeas), (*itm).estimate() );
385  }
386 
387  } // end for
388 }
void reserve(unsigned int n)
Definition: Trajectory.h:150
DataContainer const & measurements() const
Definition: Trajectory.h:196
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:44
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
static MuonRecHitPointer specificBuild(const GeomDet *geom, const TrackingRecHit *rh)
void push(const TrajectoryMeasurement &tm)
Definition: Trajectory.cc:50
def move(src, dest)
Definition: eostools.py:511
MeasurementEstimator* StandAloneMuonFilter::estimator ( void  ) const
inline

access at the estimator

Definition at line 105 of file StandAloneMuonFilter.h.

References PhotonConversionTrajectorySeedProducerFromQuadruplets_cfi::propagator.

Referenced by findBestMeasurements().

105 {return theEstimator;}
MeasurementEstimator * theEstimator
The Estimator.
std::vector< TrajectoryMeasurement > StandAloneMuonFilter::findBestMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface tsos 
)
private

Definition at line 298 of file StandAloneMuonFilter.cc.

References bestMeasurementFinder(), estimator(), MuonBestMeasurementFinder::findBestMeasurement(), MuonDetLayerMeasurements::groupedMeasurements(), GeometricSearchDet::hasGroups(), LogTrace, MuonDetLayerMeasurements::measurements(), metname, outsideIn, propagator(), mps_fire::result, groupFilesInBlocks::reverse, AlCaHLTBitMon_QueryRunRegistry::string, theFitDirection, theMeasurementExtractor, and theOverlappingChambersFlag.

Referenced by refit().

299  {
300 
301  const std::string metname = "Muon|RecoMuon|StandAloneMuonFilter";
302 
303  std::vector<TrajectoryMeasurement> result;
304  std::vector<TrajectoryMeasurement> measurements;
305 
306  if(theOverlappingChambersFlag && layer->hasGroups()){
307 
308  std::vector<TrajectoryMeasurementGroup> measurementGroups =
310 
311  if(theFitDirection == outsideIn){
312  LogTrace(metname) << "Reversing the order of groupedMeasurements as the direction of the fit is outside-in";
313  reverse(measurementGroups.begin(),measurementGroups.end());
314  // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or
315  // RecoMuon/DetLayers/MuRingForwardDoubleLayer
316  }
317 
318 
319  for(std::vector<TrajectoryMeasurementGroup>::const_iterator tmGroupItr = measurementGroups.begin();
320  tmGroupItr != measurementGroups.end(); ++tmGroupItr){
321 
322  measurements = tmGroupItr->measurements();
323  LogTrace(metname) << "Number of Trajectory Measurement: " << measurements.size();
324 
325  const TrajectoryMeasurement* bestMeasurement
327 
328  if(bestMeasurement) result.push_back(*bestMeasurement);
329  }
330  }
331  else{
332  measurements = theMeasurementExtractor->measurements(layer, tsos, *propagator(), *estimator());
333  LogTrace(metname) << "Number of Trajectory Measurement: " << measurements.size();
334  const TrajectoryMeasurement* bestMeasurement
335  = bestMeasurementFinder()->findBestMeasurement(measurements,
336  propagator());
337  if(bestMeasurement) result.push_back(*bestMeasurement);
338  }
339  return result;
340 }
MeasurementEstimator * estimator() const
access at the estimator
const std::string metname
std::vector< TrajectoryMeasurementGroup > groupedMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, const edm::Event &iEvent)
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
MeasurementContainer measurements(const DetLayer *layer, const GeomDet *det, const TrajectoryStateOnSurface &stateOnDet, const MeasurementEstimator &est, const edm::Event &iEvent)
#define LogTrace(id)
const Propagator * propagator() const
access at the propagator
NavigationDirection theFitDirection
the propagation direction
TrajectoryMeasurement * findBestMeasurement(std::vector< TrajectoryMeasurement > &measC, const Propagator *propagator)
return the Tm with the best chi2: no cut applied.
MuonBestMeasurementFinder * bestMeasurementFinder() const
Access to the best measurement finder.
NavigationDirection StandAloneMuonFilter::fitDirection ( ) const
inline

Return the fit direction.

Definition at line 99 of file StandAloneMuonFilter.h.

Referenced by propagationDirection(), and StandAloneMuonFilter().

99 {return theFitDirection;}
NavigationDirection theFitDirection
the propagation direction
int StandAloneMuonFilter::getCSCChamberUsed ( ) const
inline
int StandAloneMuonFilter::getCSCCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getDTChamberUsed ( ) const
inline
int StandAloneMuonFilter::getDTCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getGEMChamberUsed ( ) const
inline
int StandAloneMuonFilter::getGEMCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getME0ChamberUsed ( ) const
inline
int StandAloneMuonFilter::getME0CompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getRPCChamberUsed ( ) const
inline
int StandAloneMuonFilter::getRPCCompatibleChambers ( ) const
inline
int StandAloneMuonFilter::getTotalChamberUsed ( ) const
inline

Definition at line 66 of file StandAloneMuonFilter.h.

int StandAloneMuonFilter::getTotalCompatibleChambers ( ) const
inline
bool StandAloneMuonFilter::goodState ( ) const
inline

Definition at line 81 of file StandAloneMuonFilter.h.

81  {return totalChambers >= 2 &&
83  onlyRPC());}
bool onlyRPC() const
True if there are only the RPC measurements.
void StandAloneMuonFilter::incrementChamberCounters ( const DetLayer layer)
private

Increment the DT,CSC,RPC counters.

Definition at line 150 of file StandAloneMuonFilter.cc.

References GeomDetEnumerators::CSC, cscChambers, GeomDetEnumerators::DT, dtChambers, GeomDetEnumerators::GEM, gemChambers, GeomDetEnumerators::ME0, me0Chambers, GeomDetEnumerators::RPCBarrel, rpcChambers, GeomDetEnumerators::RPCEndcap, DetLayer::subDetector(), and totalChambers.

Referenced by refit().

150  {
151 
153  else if(layer->subDetector()==GeomDetEnumerators::CSC) cscChambers++;
155  else if(layer->subDetector()==GeomDetEnumerators::GEM) gemChambers++;
156  else if(layer->subDetector()==GeomDetEnumerators::ME0) me0Chambers++;
157  else
158  LogError("Muon|RecoMuon|StandAloneMuonFilter")
159  << "Unrecognized module type in incrementChamberCounters";
160  // FIXME:
161  // << layer->module() << " " <<layer->Part() << endl;
162 
163  totalChambers++;
164 }
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
void StandAloneMuonFilter::incrementCompatibleChamberCounters ( const DetLayer layer)
private

Definition at line 166 of file StandAloneMuonFilter.cc.

References GeomDetEnumerators::CSC, cscCompatibleChambers, GeomDetEnumerators::DT, dtCompatibleChambers, GeomDetEnumerators::GEM, gemCompatibleChambers, GeomDetEnumerators::ME0, me0CompatibleChambers, GeomDetEnumerators::RPCBarrel, rpcCompatibleChambers, GeomDetEnumerators::RPCEndcap, DetLayer::subDetector(), and totalCompatibleChambers.

Referenced by refit().

166  {
167 
173  else
174  LogError("Muon|RecoMuon|StandAloneMuonFilter")
175  << "Unrecognized module type in incrementCompatibleChamberCounters";
176 
178 }
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
bool StandAloneMuonFilter::isCompatibilitySatisfied ( ) const
inline
FreeTrajectoryState StandAloneMuonFilter::lastButOneUpdatedFTS ( ) const
inline

the last but one free trajectory state

Definition at line 50 of file StandAloneMuonFilter.h.

FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface StandAloneMuonFilter::lastButOneUpdatedTSOS ( ) const
inline

the Trajectory state on the last surface of the fitting

Definition at line 59 of file StandAloneMuonFilter.h.

References reset().

TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface StandAloneMuonFilter::lastCompatibleTSOS ( ) const
inline

the Trajectory state on the last compatible surface

Definition at line 53 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

53 {return theLastCompatibleTSOS;}
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
const DetLayer* StandAloneMuonFilter::lastDetLayer ( ) const
inline

return the last det layer

Definition at line 93 of file StandAloneMuonFilter.h.

93 {return theDetLayers.back();}
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
FreeTrajectoryState StandAloneMuonFilter::lastUpdatedFTS ( ) const
inline

the last free trajectory state

Definition at line 47 of file StandAloneMuonFilter.h.

FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
TrajectoryStateOnSurface StandAloneMuonFilter::lastUpdatedTSOS ( ) const
inline

the Trajectory state on the last surface of the fitting

Definition at line 56 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

56 {return theLastUpdatedTSOS;}
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
std::vector<const DetLayer*> StandAloneMuonFilter::layers ( ) const
inline

return the layer used for the refit

Definition at line 90 of file StandAloneMuonFilter.h.

90 {return theDetLayers;}
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
bool StandAloneMuonFilter::onlyRPC ( ) const
inline

True if there are only the RPC measurements.

Definition at line 102 of file StandAloneMuonFilter.h.

102 {return theRPCLoneliness;}
bool theRPCLoneliness
True if there are only the RPC measurements.
PropagationDirection StandAloneMuonFilter::propagationDirection ( void  ) const

Return the propagation direction.

Definition at line 127 of file StandAloneMuonFilter.cc.

References alongMomentum, anyDirection, fitDirection(), and oppositeToMomentum.

Referenced by refit().

127  {
128  if( fitDirection() == 0 ) return alongMomentum;
129  else if ( fitDirection() == 1 ) return oppositeToMomentum;
130  else return anyDirection;
131 }
NavigationDirection fitDirection() const
Return the fit direction.
const Propagator * StandAloneMuonFilter::propagator ( ) const

access at the propagator

Definition at line 122 of file StandAloneMuonFilter.cc.

References thePropagatorName, and theService.

Referenced by findBestMeasurements(), and update().

122  {
123  return &*theService->propagator(thePropagatorName);
124 }
std::string thePropagatorName
the propagator name
const MuonServiceProxy * theService
void StandAloneMuonFilter::refit ( const TrajectoryStateOnSurface initialState,
const DetLayer initialLayer,
Trajectory trajectory 
)

Perform the inner-outward fitting.

Definition at line 204 of file StandAloneMuonFilter.cc.

References compatibleLayers(), debug, MuonPatternRecoDumper::dumpLayer(), PV3DBase< T, PVType, FrameType >::eta(), findBestMeasurements(), TrajectoryStateOnSurface::freeTrajectoryState(), TrajectoryStateOnSurface::globalPosition(), incrementChamberCounters(), incrementCompatibleChamberCounters(), LogTrace, metname, FreeTrajectoryState::momentum(), propagationDirection(), reset(), AlCaHLTBitMon_QueryRunRegistry::string, theDetLayers, theLastButOneUpdatedTSOS, theLastCompatibleTSOS, theLastUpdatedTSOS, and update().

Referenced by StandAloneMuonTrajectoryBuilder::trajectories().

205  {
206 
207  const std::string metname = "Muon|RecoMuon|StandAloneMuonFilter";
208 
209  // reset the refitter each seed refinement
210  reset();
211 
213 
214  LogTrace(metname) << "Starting the refit"<<endl;
215 
216  // this is the most outward TSOS (updated or predicted) onto a DetLayer
218 
219  double eta0 = initialTSOS.freeTrajectoryState()->momentum().eta();
220  vector<const DetLayer*> detLayers = compatibleLayers(initialLayer,*initialTSOS.freeTrajectoryState(),
222 
223  LogTrace(metname)<<"compatible layers found: "<<detLayers.size()<<endl;
224 
225  vector<const DetLayer*>::const_iterator layer;
226 
227  // the layers are ordered in agreement with the fit/propagation direction
228  for ( layer = detLayers.begin(); layer!= detLayers.end(); ++layer ) {
229 
230  // bool firstTime = true;
231 
232  LogTrace(metname) << debug.dumpLayer(*layer);
233 
234  LogTrace(metname) << "search Trajectory Measurement from: " << lastTSOS.globalPosition();
235 
236  // pick the best measurement from each group
237  std::vector<TrajectoryMeasurement> bestMeasurements = findBestMeasurements(*layer, lastTSOS);
238 
239  // RB: Different ways can be choosen if no bestMeasurement is available:
240  // 1- check on lastTSOS-initialTSOS eta difference
241  // 2- check on lastTSOS-lastButOneUpdatedTSOS eta difference
242  // After this choice:
243  // A- extract the measurements compatible with the initialTSOS (seed)
244  // B- extract the measurements compatible with the lastButOneUpdatedTSOS
245  // In ORCA the choice was 1A. Here I will try 1B and if it fail I'll try 1A
246  // another possibility could be 2B and then 1A.
247 
248  // if no measurement found and the current TSOS has an eta very different
249  // wrt the initial one (i.e. seed), then try to find the measurements
250  // according to the lastButOne FTS. (1B)
251  double lastdEta = fabs(lastTSOS.freeTrajectoryState()->momentum().eta() - eta0);
252  if( bestMeasurements.empty() && lastdEta > 0.1) {
253  LogTrace(metname) << "No measurement and big eta variation wrt seed" << endl
254  << "trying with lastButOneUpdatedTSOS";
255  bestMeasurements = findBestMeasurements(*layer, theLastButOneUpdatedTSOS);
256  }
257 
258  //if no measurement found and the current FTS has an eta very different
259  //wrt the initial one (i.e. seed), then try to find the measurements
260  //according to the initial FTS. (1A)
261  if( bestMeasurements.empty() && lastdEta > 0.1) {
262  LogTrace(metname) << "No measurement and big eta variation wrt seed" << endl
263  << "tryng with seed TSOS";
264  bestMeasurements = findBestMeasurements(*layer, initialTSOS);
265  }
266 
267  // FIXME: uncomment this line!!
268  // if(!bestMeasurement && firstTime) break;
269 
270  if(!bestMeasurements.empty()) {
272  bool added = false;
273  for(std::vector<TrajectoryMeasurement>::const_iterator tmItr = bestMeasurements.begin();
274  tmItr != bestMeasurements.end(); ++tmItr){
275  added |= update(*layer, &(*tmItr), trajectory);
276  lastTSOS = theLastUpdatedTSOS;
277  }
278  if(added) {
279  incrementChamberCounters(*layer);
280  theDetLayers.push_back(*layer);
281  }
282  }
283  // SL in case no valid mesurement is found, still I want to use the predicted
284  // state for the following measurement serches. I take the first in the
285  // container. FIXME!!! I want to carefully check this!!!!!
286  else{
287  LogTrace(metname)<<"No best measurement found"<<endl;
288  // if (!theMeasurementCache.empty()){
289  // LogTrace(metname)<<"but the #of measurement is "<<theMeasurementCache.size()<<endl;
290  // lastTSOS = theMeasurementCache.front().predictedState();
291  // }
292  }
293  } // loop over layers
294 }
std::string dumpLayer(const DetLayer *layer) const
const std::string metname
void incrementCompatibleChamberCounters(const DetLayer *layer)
GlobalPoint globalPosition() const
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
void incrementChamberCounters(const DetLayer *layer)
Increment the DT,CSC,RPC counters.
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
GlobalVector momentum() const
#define LogTrace(id)
PropagationDirection propagationDirection() const
Return the propagation direction.
#define debug
Definition: HDRShower.cc:19
bool update(const DetLayer *layer, const TrajectoryMeasurement *meas, Trajectory &trajectory)
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
std::vector< const DetLayer * > compatibleLayers(const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
Set the rigth Navigation.
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
T eta() const
Definition: PV3DBase.h:76
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
std::vector< TrajectoryMeasurement > findBestMeasurements(const DetLayer *layer, const TrajectoryStateOnSurface &tsos)
void StandAloneMuonFilter::reset ( void  )

Definition at line 134 of file StandAloneMuonFilter.cc.

References cscChambers, cscCompatibleChambers, dtChambers, dtCompatibleChambers, gemChambers, gemCompatibleChambers, MuonTrajectoryUpdator::makeFirstTime(), me0Chambers, me0CompatibleChambers, rpcChambers, rpcCompatibleChambers, theDetLayers, theLastButOneUpdatedTSOS, theLastCompatibleTSOS, theLastUpdatedTSOS, theMuonUpdator, totalChambers, and totalCompatibleChambers.

Referenced by refit(), and StandAloneMuonTrajectoryBuilder::~StandAloneMuonTrajectoryBuilder().

134  {
137 
139 
141 
142  theDetLayers.clear();
143 }
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)
void makeFirstTime()
reset the theFirstTSOSFlag
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
std::vector< const DetLayer * > theDetLayers
the det layer used in the reconstruction
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
void StandAloneMuonFilter::setEvent ( const edm::Event event)
virtual

Pass the Event to the algo at each event.

Definition at line 145 of file StandAloneMuonFilter.cc.

References MuonDetLayerMeasurements::setEvent(), and theMeasurementExtractor.

Referenced by StandAloneMuonTrajectoryBuilder::setEvent().

145  {
147 }
MuonDetLayerMeasurements * theMeasurementExtractor
The Measurement extractor.
void setEvent(const edm::Event &)
set event
void StandAloneMuonFilter::setLastButOneUpdatedTSOS ( TrajectoryStateOnSurface  tsos)
inlineprivate

Set the last but one TSOS.

Definition at line 127 of file StandAloneMuonFilter.h.

References update.

127 { theLastButOneUpdatedTSOS = tsos;}
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
void StandAloneMuonFilter::setLastCompatibleTSOS ( TrajectoryStateOnSurface  tsos)
inlineprivate

Set the last compatible TSOS.

Definition at line 121 of file StandAloneMuonFilter.h.

121 { theLastCompatibleTSOS = tsos;}
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
void StandAloneMuonFilter::setLastUpdatedTSOS ( TrajectoryStateOnSurface  tsos)
inlineprivate

Set the last TSOS.

Definition at line 124 of file StandAloneMuonFilter.h.

124 { theLastUpdatedTSOS = tsos;}
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
bool StandAloneMuonFilter::update ( const DetLayer layer,
const TrajectoryMeasurement meas,
Trajectory trajectory 
)
private

Definition at line 345 of file StandAloneMuonFilter.cc.

References debug, MuonPatternRecoDumper::dumpTSOS(), LogTrace, metname, propagator(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, theLastButOneUpdatedTSOS, theLastCompatibleTSOS, theLastUpdatedTSOS, MuonTrajectoryUpdator::update(), and updator().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), refit(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

348 {
349  const std::string metname = "Muon|RecoMuon|StandAloneMuonFilter";
351 
352  LogTrace(metname)<<"best measurement found" << "\n"
353  <<"updating the trajectory..."<<endl;
354  pair<bool,TrajectoryStateOnSurface> result = updator()->update(meas,
355  trajectory,
356  propagator());
357  LogTrace(metname)<<"trajectory updated: "<<result.first<<endl;
358  LogTrace(metname) << debug.dumpTSOS(result.second);
359 
360  if(result.first){
362  theLastUpdatedTSOS = result.second;
363  }
364 
365  if(result.second.isValid())
366  theLastCompatibleTSOS = result.second;
367 
368  return result.first;
369 }
const std::string metname
TrajectoryStateOnSurface theLastCompatibleTSOS
the trajectory state on the last compatible surface
std::string dumpTSOS(const TrajectoryStateOnSurface &tsos) const
#define LogTrace(id)
const Propagator * propagator() const
access at the propagator
#define debug
Definition: HDRShower.cc:19
MuonTrajectoryUpdator * updator() const
access at the muon updator
TrajectoryStateOnSurface theLastButOneUpdatedTSOS
the trajectory state on the last but one available surface
TrajectoryStateOnSurface theLastUpdatedTSOS
the trajectory state on the last available surface
virtual std::pair< bool, TrajectoryStateOnSurface > update(const TrajectoryMeasurement *measurement, Trajectory &trajectory, const Propagator *propagator)
update the Trajectory with the TrajectoryMeasurement
MuonTrajectoryUpdator* StandAloneMuonFilter::updator ( ) const
inline

access at the muon updator

Definition at line 111 of file StandAloneMuonFilter.h.

Referenced by update().

111 {return theMuonUpdator;}
MuonTrajectoryUpdator * theMuonUpdator
the muon updator (it doesn&#39;t inhert from an updator, but it has one!)

Member Data Documentation

int StandAloneMuonFilter::cscChambers
private

Definition at line 192 of file StandAloneMuonFilter.h.

Referenced by incrementChamberCounters(), and reset().

int StandAloneMuonFilter::cscCompatibleChambers
private

Definition at line 199 of file StandAloneMuonFilter.h.

Referenced by incrementCompatibleChamberCounters(), and reset().

int StandAloneMuonFilter::dtChambers
private

Definition at line 191 of file StandAloneMuonFilter.h.

Referenced by incrementChamberCounters(), and reset().

int StandAloneMuonFilter::dtCompatibleChambers
private

Definition at line 198 of file StandAloneMuonFilter.h.

Referenced by incrementCompatibleChamberCounters(), and reset().

int StandAloneMuonFilter::gemChambers
private

Definition at line 194 of file StandAloneMuonFilter.h.

Referenced by incrementChamberCounters(), and reset().

int StandAloneMuonFilter::gemCompatibleChambers
private

Definition at line 201 of file StandAloneMuonFilter.h.

Referenced by incrementCompatibleChamberCounters(), and reset().

int StandAloneMuonFilter::me0Chambers
private

Definition at line 195 of file StandAloneMuonFilter.h.

Referenced by incrementChamberCounters(), and reset().

int StandAloneMuonFilter::me0CompatibleChambers
private

Definition at line 202 of file StandAloneMuonFilter.h.

Referenced by incrementCompatibleChamberCounters(), and reset().

int StandAloneMuonFilter::rpcChambers
private

Definition at line 193 of file StandAloneMuonFilter.h.

Referenced by incrementChamberCounters(), and reset().

int StandAloneMuonFilter::rpcCompatibleChambers
private

Definition at line 200 of file StandAloneMuonFilter.h.

Referenced by incrementCompatibleChamberCounters(), and reset().

MuonBestMeasurementFinder* StandAloneMuonFilter::theBestMeasurementFinder
private

The best measurement finder: search for the best measurement among the TMs available.

Definition at line 164 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonFilter(), and ~StandAloneMuonFilter().

std::vector<const DetLayer*> StandAloneMuonFilter::theDetLayers
private

the det layer used in the reconstruction

Definition at line 178 of file StandAloneMuonFilter.h.

Referenced by refit(), and reset().

MeasurementEstimator* StandAloneMuonFilter::theEstimator
private

The Estimator.

Definition at line 156 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonFilter(), and ~StandAloneMuonFilter().

NavigationDirection StandAloneMuonFilter::theFitDirection
private

the propagation direction

Definition at line 175 of file StandAloneMuonFilter.h.

Referenced by findBestMeasurements(), and StandAloneMuonFilter().

TrajectoryStateOnSurface StandAloneMuonFilter::theLastButOneUpdatedTSOS
private

the trajectory state on the last but one available surface

Definition at line 150 of file StandAloneMuonFilter.h.

Referenced by refit(), reset(), and update().

TrajectoryStateOnSurface StandAloneMuonFilter::theLastCompatibleTSOS
private

the trajectory state on the last compatible surface

Definition at line 146 of file StandAloneMuonFilter.h.

Referenced by refit(), reset(), and update().

TrajectoryStateOnSurface StandAloneMuonFilter::theLastUpdatedTSOS
private

the trajectory state on the last available surface

Definition at line 148 of file StandAloneMuonFilter.h.

Referenced by refit(), reset(), and update().

double StandAloneMuonFilter::theMaxChi2
private

The max allowed chi2 to accept a rechit in the fit.

Definition at line 169 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonFilter().

MuonDetLayerMeasurements* StandAloneMuonFilter::theMeasurementExtractor
private
MuonTrajectoryUpdator* StandAloneMuonFilter::theMuonUpdator
private

the muon updator (it doesn't inhert from an updator, but it has one!)

Definition at line 159 of file StandAloneMuonFilter.h.

Referenced by reset(), StandAloneMuonFilter(), and ~StandAloneMuonFilter().

std::string StandAloneMuonFilter::theMuonUpdatorName
private

its name

Definition at line 161 of file StandAloneMuonFilter.h.

std::string StandAloneMuonFilter::theNavigationType
private

Navigation type "Direct","Standard"

Definition at line 185 of file StandAloneMuonFilter.h.

Referenced by compatibleLayers(), and StandAloneMuonFilter().

double StandAloneMuonFilter::theNSigma
private

The errors of the trajectory state are multiplied by nSigma to define acceptance of BoundPlane and maximalLocalDisplacement

Definition at line 172 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonFilter().

bool StandAloneMuonFilter::theOverlappingChambersFlag
private

Definition at line 205 of file StandAloneMuonFilter.h.

Referenced by findBestMeasurements().

std::string StandAloneMuonFilter::thePropagatorName
private

the propagator name

Definition at line 181 of file StandAloneMuonFilter.h.

Referenced by propagator(), and StandAloneMuonFilter().

bool StandAloneMuonFilter::theRPCLoneliness
private

True if there are only the RPC measurements.

Definition at line 188 of file StandAloneMuonFilter.h.

Referenced by StandAloneMuonFilter().

const MuonServiceProxy* StandAloneMuonFilter::theService
private

Definition at line 204 of file StandAloneMuonFilter.h.

Referenced by compatibleLayers(), and propagator().

int StandAloneMuonFilter::totalChambers
private

Definition at line 190 of file StandAloneMuonFilter.h.

Referenced by incrementChamberCounters(), and reset().

int StandAloneMuonFilter::totalCompatibleChambers
private

Definition at line 197 of file StandAloneMuonFilter.h.

Referenced by incrementCompatibleChamberCounters(), and reset().